/* Step Counter RPG prototype styles.
   Pixel sprites and icons sit on painted backgrounds. Pixel font for
   headings and buttons, a normal font for reading. */
@font-face { font-family: 'Tiny5'; src: url(../fonts/tiny5-latin-400-normal.woff2) format('woff2'); font-weight: 400 700; }

:root {
  --bg: #16110d;
  --panel: #241c16;
  --panel2: #2f251d;
  --line: #4a3a2c;
  --ink: #f1e6d2;
  --muted: #b3a38a;
  --gold: #e8b64a;
  --gold2: #b7832a;
  --red: #d2553f;
  --green: #6fb85a;
  --blue: #5a9bd6;
  --purple: #a77be0;
  --pixel: 'Tiny5', 'Trebuchet MS', sans-serif;
  --body: system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0c0907 url(../assets/map/world_map.jpg) center / cover fixed;
  color: var(--ink); font: 15px/1.4 var(--body);
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ''; position: fixed; inset: 0; background: rgba(8,6,4,.78); backdrop-filter: blur(3px); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.px, .hero-sprite { image-rendering: pixelated; image-rendering: crisp-edges; }
.muted { color: var(--muted); }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0; }
.pad { padding: 0 14px; }
.center { text-align: center; }
h1, h2, h3, h4, .btn, .tab, .nav span, .title, .pill, .badge { font-family: var(--pixel); letter-spacing: .3px; font-weight: 400; font-synthesis: none; }

#phone {
  position: relative; margin: 0 auto; width: 100%; max-width: 440px; height: 100vh; height: 100dvh;
  background: var(--bg); overflow: hidden; box-shadow: 0 0 60px rgba(0,0,0,.8);
}
@media (min-width: 600px) and (min-height: 700px) {
  #phone { height: min(900px, 96vh); margin-top: 2vh; border-radius: 26px; border: 6px solid #2a2019; }
}
.screen { position: absolute; inset: 0; overflow: hidden; }

#musicBtn { position: absolute; top: 8px; right: 8px; z-index: 50; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--muted); font-size: 16px; line-height: 1; }
#musicBtn.on { color: var(--gold); border-color: var(--gold2); }
.screen.game ~ #musicBtn { top: 48px; right: 10px; width: 26px; height: 26px; font-size: 14px; }
.auth a { color: var(--gold); }

/* ---------- Buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; min-height: 40px; border-radius: 8px; border: 2px solid #1a130e;
  background: linear-gradient(#4b3a2b, #3a2c20); color: var(--ink); font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 0 #120d09;
}
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: linear-gradient(#f0c35c, #c48b2c); color: #2a1a07; }
.btn.danger { background: linear-gradient(#c9523d, #8e2f22); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.btn.on { outline: 2px solid var(--gold); }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn.big { min-height: 48px; font-size: 18px; }
.btn.wide { width: calc(100% - 28px); margin: 10px 14px; }
.btn .ico { width: 20px; height: 20px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; font-size: 13px; }
input:not([type]), input[type=text], input[type=email], input[type=password], .addrow input, .searchrow input, .chatin input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--line); background: #120e0b; color: var(--ink); outline: none; margin-top: 4px;
}
input:focus { border-color: var(--gold2); }
input[type=range] { width: 100%; accent-color: var(--gold); }
label { display: block; font-size: 13px; color: var(--muted); }
label.tick { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; margin: 6px 0; }
label.tick input { width: 18px; height: 18px; accent-color: var(--gold); }
.err { color: #ff8a73; font-size: 13px; min-height: 1em; margin: 2px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 14px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.checks { list-style: none; padding: 0; margin: -4px 0 0; font-size: 12px; }
.checks li { padding-left: 18px; position: relative; color: var(--muted); }
.checks li::before { position: absolute; left: 0; content: '✗'; color: #ff8a73; }
.checks li.ok::before { content: '✓'; color: var(--green); }
.checks li.ok { color: #cfe8c4; }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #3a2e24; color: var(--muted); vertical-align: middle; }
.pill.go { background: #2f4d27; color: #bfe8ae; }
.stepsbox .fine.tappable { text-decoration: underline dotted; cursor: pointer; }
.pill.risk.hard { background: #5a4313; color: #ffd98a; }
.pill.risk.deadly { background: #6a1f17; color: #ffb49e; }
.pill.mod { background: #5a2a1f; color: #ffb49e; }
.pill.mem { background: #4d3a14; color: var(--gold); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; background: #2f4d27; color: #c8f0b8; }
.badge.hardcore { background: #5c1d17; color: #ffb3a6; }
.badge.sm { font-size: 10px; padding: 0 4px; }

/* ---------- Sprites ---------- */
.hero-sprite {
  --s: 3; width: calc(48px * var(--s)); height: calc(40px * var(--s));
  background-repeat: no-repeat; background-size: calc(576px * var(--s)) calc(40px * var(--s));
  flex: none;
}
.hero-sprite.idle { animation: sp-idle .9s steps(4) infinite; }
.hero-sprite.walk { animation: sp-walk .8s steps(8) infinite; }
@keyframes sp-idle { from { background-position: 0 0; } to { background-position: calc(-192px * var(--s)) 0; } }
@keyframes sp-walk { from { background-position: calc(-192px * var(--s)) 0; } to { background-position: calc(-576px * var(--s)) 0; } }
.ico { width: 24px; height: 24px; vertical-align: middle; object-fit: contain; }
.ico.big { width: 36px; height: 36px; }
.ico.xl { width: 64px; height: 64px; }
.itemico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: #16110d; border: 2px solid #5b4a3a; flex: none; }
.itemico img { width: 32px; height: 32px; }
.itemico.xl { width: 84px; height: 84px; } .itemico.xl img { width: 64px; height: 64px; }
.itemico.r1 { border-color: #5fae4e; } .itemico.r2 { border-color: #4f8fd6; } .itemico.r3 { border-color: #a26ee0; } .itemico.r4 { border-color: #e8a53a; }
.itemico.emptyslot { border-style: dashed; }
.rar.r0 { color: #ddd; } .rar.r1 { color: #7fd06d; } .rar.r2 { color: #6fb0f0; } .rar.r3 { color: #c49bf3; } .rar.r4 { color: #f3b34a; }
.monster { image-rendering: pixelated; }
svg.msprite { overflow: hidden; display: inline-block; vertical-align: bottom; }
svg.msprite image { image-rendering: pixelated; image-rendering: crisp-edges; }
.monster.thumb { width: 44px; height: 44px; object-fit: contain; }
.monster.big { width: 180px; height: 150px; object-fit: contain; }

/* ---------- Log in and character screens ---------- */
.auth { overflow-y: auto; }
.auth-bg { position: absolute; inset: 0; background: url(../assets/map/world_map.jpg) 0 50% / auto 130% repeat-x; animation: pan 90s linear infinite alternate; }
.auth-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(12,9,7,.55), rgba(12,9,7,.9) 70%); }
.auth-bg.dim::after { background: rgba(12,9,7,.86); }
@keyframes pan { from { background-position: 0 50%; } to { background-position: -900px 50%; } }
.auth-inner { position: relative; padding: 36px 20px 30px; display: flex; flex-direction: column; align-items: stretch; min-height: 100%; }
.auth-inner.wide { padding: 26px 0 30px; }
.auth-inner.wide > * { margin-left: 16px; margin-right: 16px; }
.auth-inner.wide > .carousel { margin: 0; }
.logo { text-align: center; margin: 10px 0 18px; }
.logo h1 { font-size: 40px; line-height: 1; margin: 6px 0 4px; color: var(--gold); text-shadow: 0 3px 0 #5a3a10, 0 0 24px rgba(232,182,74,.35); }
.logo .tag { margin: 0; color: var(--muted); font-family: var(--pixel); }
.logo-sprites { display: flex; justify-content: center; gap: 0; height: 80px; }
.auth .card { margin: 0; background: rgba(36,28,22,.92); }
.or { text-align: center; color: var(--muted); font-size: 12px; position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: #241c16; padding: 0 8px; }
.auth .linkbtn { align-self: center; margin-top: 10px; }
.auth .fine { text-align: center; }
.title { text-align: center; color: var(--gold); margin: 6px 0 14px; font-size: 24px; }
.title.big { font-size: 34px; }
.coc { padding-left: 20px; } .coc li { margin: 6px 0; }

.carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 16px 14px; scrollbar-width: thin; }
.ccard {
  flex: 0 0 72%; scroll-snap-align: center; background: rgba(36,28,22,.95); border: 2px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.ccard .cname { font-family: var(--pixel); font-size: 22px; color: var(--gold); }
.ccard .cicon { width: 150px; height: 130px; display: grid; place-items: center; background: radial-gradient(#3a2d22, #1b1510); border-radius: 12px; border: 1px solid var(--line); }
.ccard .cicon.plus { font-size: 60px; color: var(--muted); font-family: var(--pixel); }
.ccard .cstats { font-size: 13px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ccard .play { width: 100%; }
.ccard.empty { border-style: dashed; justify-content: center; }
.ccard.locked { opacity: .6; }
.hint { text-align: center; font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.charsel .btn.big { margin-top: 4px; }

.steps { display: flex; justify-content: center; gap: 6px; font-family: var(--pixel); font-size: 13px; }
.steps span { padding: 4px 10px; border-radius: 20px; background: #2a211a; color: var(--muted); }
.steps span.on { background: var(--gold); color: #2a1a07; }
.steps span.done { color: var(--green); }
.classlist { display: flex; flex-direction: column; gap: 10px; }
.classcard, .modecard {
  display: flex; gap: 10px; text-align: left; background: rgba(36,28,22,.95); border: 2px solid var(--line); border-radius: 12px; padding: 10px; align-items: flex-start;
}
.classcard.on, .modecard.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,182,74,.25); }
.cc-sprite { width: 110px; display: grid; place-items: center; background: radial-gradient(#3a2d22, #1b1510); border-radius: 10px; min-height: 110px; }
.cc-sprite .hero-sprite { --s: 3 !important; }
.cc-text b { font-family: var(--pixel); font-size: 20px; color: var(--gold); }
.cc-text p { margin: 2px 0 6px; font-size: 13px; }
.cc-text .perk { color: #cfe8c4; }
.cc-text .perk .ico { width: 18px; height: 18px; }
.statrow { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 11px; color: var(--muted); }
.statrow span { display: flex; align-items: center; gap: 6px; }
.statrow i { display: block; height: 6px; background: var(--gold2); border-radius: 3px; }
.modes { display: flex; flex-direction: column; gap: 12px; }
.modecard { flex-direction: column; }
.modecard b { font-family: var(--pixel); font-size: 22px; color: var(--gold); }
.modecard.hc b { color: #ff9a86; }
.modecard ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.navrow { display: flex; gap: 10px; margin-top: 16px !important; }
.navrow .btn { flex: 1; }
.namepreview { display: flex; flex-direction: column; align-items: center; margin: 0 0 8px; }
.np-name { font-family: var(--pixel); color: var(--gold); font-size: 20px; background: rgba(0,0,0,.5); padding: 2px 10px; border-radius: 6px; min-height: 30px; }
.confirmchar { display: flex; gap: 12px; align-items: center; }

/* ---------- Game shell ---------- */
.screen.game { display: flex; flex-direction: column; }
.hud { flex: none; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 10px; padding: 8px 10px 6px; background: linear-gradient(#2d231b, #1d1611); border-bottom: 2px solid #0e0a07; cursor: pointer; }
.hud-who { grid-row: span 2; display: flex; align-items: center; gap: 4px; min-width: 0; }
.hud-who .hero-sprite { margin: -22px -16px -14px -22px; }
.hud-who b { font-family: var(--pixel); font-size: 15px; }
.hud-who small { display: block; color: var(--muted); font-size: 11px; }
.hud-bars { display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.hud-cur { grid-column: 2; display: flex; gap: 14px; font-family: var(--pixel); font-size: 14px; }
.hud-cur .ico { width: 18px; height: 18px; margin-right: 3px; }
.bar { position: relative; height: 16px; background: #0e0a07; border-radius: 8px; overflow: hidden; border: 1px solid #000; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#8fd06f, #4f9a3a); transition: width .3s; }
.bar.hp i { background: linear-gradient(#ef7a5f, #b33a26); }
.bar.mp i { background: linear-gradient(#77b4ee, #3a6fae); }
.bar.xp i { background: linear-gradient(#c49bf3, #7a4fb8); }
.bar.road i { background: linear-gradient(#f0c35c, #b7832a); }
.bar.resolve i { background: linear-gradient(#ffe08a, #d19b2c); }
.bar span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 14px; text-shadow: 0 1px 1px #000; }
.card .bar { margin: 6px 0; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; }
.nav { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); background: #1b1510; border-top: 2px solid #0e0a07; padding-bottom: env(safe-area-inset-bottom); }
.nav button { position: relative; background: none; border: 0; padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.nav button .ico { width: 28px; height: 28px; opacity: .7; }
.nav button span { font-size: 12px; }
.nav button.on { color: var(--gold); background: linear-gradient(transparent, rgba(232,182,74,.12)); }
.nav button.on .ico { opacity: 1; }
.nb:empty { display: none; }
/* Red count on a Menu tile or a tab: what the badge on the bottom bar is counting. */
.tile, .tab { position: relative; }
.tb { position: absolute; top: 4px; right: 6px; background: var(--red); color: #fff; font-style: normal; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; padding: 0 4px; font-family: var(--pixel); text-align: center; }
.tab .tb { top: -6px; right: -4px; }
.nb { position: absolute; top: 3px; left: 54%; background: var(--red); color: #fff; font-style: normal; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; padding: 0 4px; font-family: var(--pixel); }

.sec { font-size: 15px; color: var(--gold); margin: 18px 14px 8px; }
.list { display: flex; flex-direction: column; gap: 6px; padding: 0 14px; }
.row { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; }
button.row:hover { background: var(--panel2); }
.row > div { flex: 1; min-width: 0; }
.row > .hero-sprite { flex: none; margin: -20px -14px -12px -18px; }
.row small { display: block; color: var(--muted); font-size: 12px; }
.row small.rw { color: #d8c38f; }
.row .chev { color: var(--muted); font-size: 22px; }
.row.dim { opacity: .55; }
.row.danger b { color: #ff9a86; }
.row:disabled { opacity: .5; }
.btnrow { display: flex; gap: 8px; padding: 10px 14px 0; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }
.empty-state { text-align: center; padding: 30px 20px; color: var(--muted); }
.backbtn { background: none; border: 0; color: var(--gold); font-family: var(--pixel); padding: 10px 14px 0; font-size: 15px; }
.phead { margin: 8px 14px 4px; padding: 18px 14px 12px; border-radius: 12px; background: #2a211a center / cover; position: relative; overflow: hidden; min-height: 70px; }
.phead[style]::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.1), rgba(10,7,5,.85)); }
.phead[style] { min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; }
.phead h2, .phead p { position: relative; margin: 0; }
.phead h2 { color: var(--gold); font-size: 24px; }
.phead p { font-size: 13px; color: #e2d5bf; margin-top: 4px; }
.tabs { display: flex; gap: 4px; padding: 10px 14px 4px; overflow-x: auto; }
.tab { flex: none; background: #241c16; border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; border-radius: 20px; font-size: 13px; }
.tab.on { background: var(--gold); color: #2a1a07; border-color: var(--gold); }

/* ---------- Travel ---------- */
.roadhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 6px; font-size: 14px; gap: 8px; }
.roadhead .danger i { color: var(--red); font-style: normal; letter-spacing: 1px; }
.bar.road { margin: 0 14px 8px; height: 18px; }
.bar.road span { line-height: 16px; font-size: 11px; }
.scene { position: relative; height: 230px; overflow: hidden; background: #3b2a2a; border-top: 2px solid #0e0a07; border-bottom: 2px solid #0e0a07; }
.layer { position: absolute; top: 0; left: 0; height: 100%; background-repeat: repeat-x; will-change: transform; }
.layer.still { width: 100%; background-size: cover; background-position: center; }
.walker { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); z-index: 4; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.walker.low { bottom: 6%; }
.layer.front { z-index: 3; opacity: .9; pointer-events: none; }
.scene-note { position: absolute; left: 8px; top: 8px; font-size: 11px; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 4px; z-index: 4; }
.stepsbox { display: flex; gap: 14px; padding: 14px; align-items: center; }
.ring { --p: 0; flex: none; width: 104px; height: 104px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), #2a211a 0); display: grid; place-items: center; }
.ring > div { width: 82px; height: 82px; border-radius: 50%; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring b { font-family: var(--pixel); font-size: 20px; }
.ring small { font-size: 11px; color: var(--muted); }
.ring.big { width: 130px; height: 130px; } .ring.big > div { width: 104px; height: 104px; }
.stepsinfo { flex: 1; min-width: 0; }
.stepsinfo .lbl { color: var(--muted); font-size: 12px; }
.stepsinfo .big { font-family: var(--pixel); font-size: 20px; color: var(--gold); }
.walkbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.walkbtns .btn { flex: 1 1 40%; min-height: 36px; padding: 5px 8px; font-size: 14px; }
.walkbtns #auto { flex-basis: 100%; }

/* ---------- Camp ---------- */
.camphead { margin: 10px 14px 0; height: 110px; border-radius: 12px; background: center / cover; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.camphead::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.05), rgba(10,7,5,.85)); }
.camphead div { position: relative; padding: 10px 14px; }
.camphead h2 { margin: 0; color: var(--gold); }
.camphead p { margin: 0; font-size: 13px; }
.ev .evpic { width: 48px; display: grid; place-items: center; }
.ev-rare { border-color: #7a58b0; background: #2a2135; }
.ev-bosssight { border-color: #8e3a2a; }

/* ---------- Fight ---------- */
.fight-wrap, .mg-wrap { position: absolute; inset: 0; z-index: 40; background: #0b0806; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.fight { display: flex; flex-direction: column; height: 100%; }
.arena { position: relative; flex: 0 0 auto; height: 46%; min-height: 250px; background: center / cover; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 12px 16px; }
.arena::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,.55)); }
.fighter { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 46%; }
.fighter b { font-family: var(--pixel); font-size: 13px; text-shadow: 0 1px 2px #000; text-align: center; }
.fighter .bar { width: 100%; }
.fightimg { max-width: 160px; max-height: 160px; min-height: 90px; object-fit: contain; image-rendering: pixelated; transform: scale(1); filter: drop-shadow(0 4px 3px rgba(0,0,0,.6)); }
.fighter.foe .fightimg { width: 150px; }
.flog { flex: 1 1 120px; min-height: 120px; padding: 8px 14px; -webkit-mask-image: linear-gradient(transparent, #000 38px); mask-image: linear-gradient(transparent, #000 38px); font-size: 14px; background: #150f0b; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.flog div:last-child { color: var(--gold); }

/* ---------- Map ---------- */
.maptools { display: flex; gap: 6px; padding: 10px 14px; flex-wrap: wrap; }
.mapbox { position: relative; height: calc(100% - 110px); min-height: 380px; overflow: auto; margin: 0 14px; border-radius: 12px; border: 2px solid var(--line); cursor: grab; }
.mapinner { position: relative; }
.mapinner img { display: block; width: 100%; user-select: none; -webkit-user-drag: none; }
.roads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.roads line { stroke: #f7e2b0; stroke-width: .25; stroke-dasharray: .8 .5; opacity: .85; vector-effect: non-scaling-stroke; stroke-width: 2.5px; }
.roads line.boat { stroke: #9fd3ff; stroke-dasharray: 3 4; }
.pin { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }
.pin i { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 2px solid #3a2410; box-shadow: 0 0 0 3px rgba(0,0,0,.3); }
.pin.town i { width: 18px; height: 18px; border-radius: 4px; background: #f3d9a0; }
.pin.here i { background: var(--green); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(111,184,90,.25); } }
.pin span { margin-top: 2px; white-space: nowrap; font-family: var(--pixel); font-size: 12px; background: rgba(20,14,10,.8); padding: 1px 6px; border-radius: 4px; }
.wpin { position: absolute; transform: translate(-50%, -80%); background: none; border: 0; padding: 0; }
.wpin .ico { width: 22px; height: 22px; filter: drop-shadow(0 0 4px #9ff); }
.mapme { position: absolute; transform: translate(-50%, -95%); pointer-events: none; z-index: 3; }
.mapme .hero-sprite { filter: drop-shadow(0 2px 2px #000); }
.v-map { display: flex; flex-direction: column; overflow: hidden; }
.v-map .mapbox { flex: 1; height: auto; }
.v-map .fine { flex: none; }
.arrive-img { width: 100%; height: 130px; object-fit: cover; border-radius: 10px; }
.roads-list { padding-left: 18px; font-size: 14px; }

/* ---------- Menu tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 14px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; text-align: center; }
.tile:hover { background: var(--panel2); border-color: var(--gold2); }

/* ---------- Sheet dialog and toast ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; animation: fadein .15s; }
.sheet-wrap.out { opacity: 0; transition: opacity .18s; }
.sheet { width: 100%; max-height: 88%; overflow: auto; background: var(--panel); border-top: 3px solid var(--gold2); border-radius: 16px 16px 0 0; padding: 12px 16px 16px; animation: up .2s; }
@keyframes up { from { transform: translateY(40px); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { margin: 4px 0; color: var(--gold); font-size: 20px; }
.x { background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; padding: 0 4px; }
.sheet-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sheet .list { padding: 0; }
.howto { padding-left: 20px; } .howto li { margin: 6px 0; }
#toast { position: absolute; left: 50%; bottom: 90px; transform: translate(-50%, 30px); opacity: 0; z-index: 80; background: #0e0a07; border: 2px solid var(--gold2); color: var(--ink); padding: 8px 14px; border-radius: 10px; font-size: 14px; transition: .25s; pointer-events: none; max-width: 86%; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Hero ---------- */
.herotop { display: flex; gap: 10px; align-items: center; padding: 12px 14px 0; }
.herotop > div:last-child { flex: 1; }
.herotop h2 { margin: 0; color: var(--gold); }
.herotop p { margin: 2px 0 6px; font-size: 13px; }
.herotop .hero-sprite { background-color: #221a14; border-radius: 12px; border: 1px solid var(--line); }
.equip { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 14px 0; }
.slot { display: flex; gap: 8px; align-items: center; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.slot small { display: block; color: var(--muted); font-size: 11px; }
.slot b { font-size: 13px; }
@keyframes glow { 50% { box-shadow: 0 0 10px rgba(232,182,74,.7); } }
.looks { display: flex; justify-content: space-around; padding: 10px; flex-wrap: wrap; }

/* ---------- Inventory and crafting ---------- */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px 14px; }
.gitem { position: relative; background: none; border: 0; padding: 0; display: grid; place-items: center; }
.gitem .itemico { width: 100%; height: auto; aspect-ratio: 1; }
.gitem em { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-family: var(--pixel); font-size: 13px; text-shadow: 0 1px 2px #000; }
.stations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 14px; }
.station { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 2px; font-size: 11px; }
.station.on { border-color: var(--gold); background: #3b2c14; }
.recipe small span { white-space: nowrap; }
.okc { color: #a8e295; } .noc { color: #ff9a86; }

/* ---------- Goals ---------- */
.goalcard { display: flex; gap: 14px; align-items: center; }
.goalcard > div:last-child { flex: 1; }
.goalcard label { color: var(--ink); }
.goalcard p { font-size: 12px; margin: 6px 0 0; }
.chart { position: relative; display: flex; gap: 6px; height: 150px; padding: 10px 14px 0; align-items: flex-end; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart .barv { width: 100%; background: #5a4a3a; border-radius: 4px 4px 0 0; max-height: 82%; }
.chart .barv.met { background: linear-gradient(#f0c35c, #b7832a); }
.chart .barv.rest { background: repeating-linear-gradient(45deg, #3a4d5a, #3a4d5a 4px, #2a3a45 4px, #2a3a45 8px); height: 20% !important; }
.chart small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.goalline { position: absolute; left: 14px; right: 14px; border-top: 2px dashed rgba(232,182,74,.6); }
.tbl { width: calc(100% - 28px); margin: 0 14px; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: normal; }
.tbl tr.hl td { background: rgba(232,182,74,.15); color: var(--gold); }
.days { display: flex; gap: 4px; margin: 8px 0; }
.day { flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--line); background: #1a140f; font-size: 12px; }
.day.on { background: #34506a; border-color: #6fa4d8; }
.addrow { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.addrow input { margin: 0; }

/* ---------- Oaths, quests, mini-games ---------- */
.oathnow { border-color: var(--gold2); }
.oathnow small { color: var(--muted); display: block; }
.oathnow b { font-family: var(--pixel); color: var(--gold); font-size: 18px; }
.mgs { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.mg { display: flex; gap: 10px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; align-items: flex-start; }
.mg b { font-family: var(--pixel); font-size: 16px; margin-right: 6px; }
.mg small { display: block; color: #d8c38f; font-size: 12px; margin-top: 2px; }
.mg p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.mg-screen { height: 100%; background: center / cover; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; position: relative; }
.mg-screen::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.mg-screen > * { position: relative; }
.mg-top { position: absolute !important; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(0,0,0,.5); font-family: var(--pixel); }
.mg-msg { background: rgba(20,14,10,.85); border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; text-align: center; }
.mg-msg p { margin: 4px 0; }
.hits { font-size: 20px; color: var(--gold); }
.fbar { position: relative; width: 100%; height: 34px; background: #0e2033; border: 3px solid #0a0a0a; border-radius: 8px; }
.fzone { position: absolute; top: 0; bottom: 0; background: rgba(111,210,90,.75); }
.needle { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 6px #fff; }

/* ---------- Community ---------- */
.chat { margin: 6px 14px; height: 50vh; max-height: 420px; overflow-y: auto; background: #120e0b; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.msg { padding: 5px 6px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.msg:hover { background: #221a14; }
.msg b { font-family: var(--pixel); margin-right: 6px; color: #e8cfa0; }
.msg b.mod { color: #ff9f86; } .msg b.member { color: var(--gold); }
.chatin { display: flex; gap: 6px; padding: 0 14px; align-items: center; }
.chatin input { margin: 0; }
.caravan { margin: 10px 0; display: grid; grid-template-columns: 1fr 1fr; font-size: 11px; color: var(--muted); }
.caravan small:last-child { text-align: right; }
.track { grid-column: 1 / -1; position: relative; height: 8px; background: #3a2e24; border-radius: 4px; margin: 14px 0 4px; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold2); border-radius: 4px; }
.track span { position: absolute; top: -16px; transform: translateX(-50%); }
.searchrow { display: flex; gap: 6px; padding: 10px 14px; align-items: center; }
.searchrow input { margin: 0; }
.bosscard { margin: 10px 14px; padding: 14px; text-align: center; background: radial-gradient(#3a1d18, #1a0f0c); border: 2px solid #6a2a1f; border-radius: 14px; }
.bosscard h3 { margin: 6px 0; color: #ffb49e; }
.monster.boss { width: 220px; height: 170px; object-fit: contain; }
.rank { min-width: 28px; padding: 0 6px; height: 28px; border-radius: 14px; display: grid; place-items: center; background: #3a2e24; font-family: var(--pixel); flex: none; }
.rank.r1 { background: var(--gold); color: #2a1a07; } .rank.r2 { background: #c8c8c8; color: #222; } .rank.r3 { background: #c98a52; color: #221; }
.tabs.scroll { flex-wrap: nowrap; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.refs, .beasts { grid-template-columns: repeat(3, 1fr); }
.ref, .beast { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: .5; }
.ref.found, .beast.found { opacity: 1; border-color: var(--gold2); }
.ref.done { background: linear-gradient(#3a2c14, var(--panel)); border-color: var(--gold); }
.ref.done small { color: var(--gold); }
.refreward { display: flex; align-items: center; gap: 10px; margin: 0 14px 8px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; }
.refreward small { display: block; color: var(--muted); }
.refreward.got { border-style: solid; border-color: var(--gold2); background: linear-gradient(#2e2412, var(--panel)); }
.refreward div { flex: 1; }
.beast:not(.found) img { filter: brightness(0); }
.ref small, .beast small { color: var(--muted); }

/* ---------- Store ---------- */
.member { border-color: var(--gold2); background: linear-gradient(#3a2c14, var(--panel)); }
.member h3 { margin: 0 0 6px; color: var(--gold); }
.member ul { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.member .btn.wide { width: 100%; margin: 0; }
.gempacks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px; }
.gp { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.gp b { font-family: var(--pixel); font-size: 20px; color: #bfe0ff; }
.gp small { color: var(--muted); }
.gp span { margin-top: 4px; font-family: var(--pixel); color: var(--gold); }

/* ---------- Moderation ---------- */
.report small.quote { color: #e2d5bf; font-style: italic; margin: 4px 0; }
.modbtns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ---------- Paper-doll characters ---------- */
/* Eder Muniz's modular pack (assets/avatar2): 36x36 frames on 360x288 sheets, one animation a row.
   The doll is drawn facing right, the way heroes walk. A 32x30 window of each frame is shown
   (--wx/--wy are where the window starts), so the box stays small. */
.av { --s: 4; --wx: 2; --wy: 6; --r: 1; position: relative; width: calc(32px * var(--s)); height: calc(30px * var(--s)); flex: none; transform: none; }
.av.hero-sprite { background: none; animation: none; }
.av > i {
  position: absolute; display: block; left: 0; top: 0; width: 100%; height: 100%;
  background-repeat: no-repeat; background-size: calc(360px * var(--s)) calc(288px * var(--s));
  background-position: calc(-1px * var(--wx) * var(--s)) calc(-1px * (var(--wy) + 36 * var(--r)) * var(--s)); image-rendering: pixelated;
}
.av.walk { --r: 0; } .av.idle { --r: 1; } .av.jump { --r: 2; } .av.attack { --r: 3; } .av.defend { --r: 4; } .av.damage { --r: 5; } .av.death { --r: 6; } .av.special { --r: 7; }
.av.walk > i { animation: av2-6 .7s steps(6) infinite; }
.av.idle > i { animation: av2-6 1s steps(6) infinite; }
.av.jump > i { animation: av2-once-3 .5s steps(2) 1 forwards; }
.av.attack > i { animation: av2-once-8 .55s steps(7) 1 forwards; }
.av.defend > i { animation: av2-once-5 .5s steps(4) 1 forwards; }
.av.damage > i { animation: av2-once-3 .35s steps(2) 1 forwards; }
.av.death > i { animation: av2-once-8 .9s steps(7) 1 forwards; }
.av.special > i { animation: av2-once-10 .9s steps(9) 1 forwards; }
@keyframes av2-3 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 108) * var(--s)); } }
@keyframes av2-5 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 180) * var(--s)); } }
@keyframes av2-6 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 216) * var(--s)); } }
@keyframes av2-8 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 288) * var(--s)); } }
@keyframes av2-10 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 360) * var(--s)); } }
.av.flip { transform: scaleX(-1); }
.ability-icon { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
/* Touch controls must never enter text-selection or long-press callout mode. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
button { touch-action: manipulation; -webkit-touch-callout: none; }
.mg-wrap button, #chold { touch-action: none; }
.hud-store { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.bag-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bag-tools .fine { width: 100%; margin: 0; }
.bag-tools select, #market-type { background: #292017; color: #f5e9cf; border: 1px solid #706044; padding: 8px; border-radius: 8px; max-width: 100%; }
.gitem.selected { outline: 3px solid var(--gold); background: #49381d; }
.timing-track { height: 54px; border: 2px solid #7a6948; border-radius: 10px; position: relative; margin: 30px 6px; background: #3a201c; }
.timing-zone { position: absolute; left: 38%; width: 24%; top: 0; bottom: 0; background: #4b9e5e; }
.timing-needle { position: absolute; top: -6px; bottom: -6px; width: 4px; background: #fff6cf; box-shadow: 0 0 6px black; }
.gamble-choices { display: flex; justify-content: center; gap: 16px; margin: 36px 0; }
.gamble-piece { font-size: 36px; min-width: 70px; min-height: 90px; }
.gamble-piece.winner { border: 3px solid var(--gold); }
.shuffling .gamble-piece { animation: gamble-shuffle .3s ease-in-out infinite alternate; }
.shuffling .gamble-piece:nth-child(2) { animation-direction: alternate-reverse; }
@keyframes gamble-shuffle { to { transform: translateX(12px) rotate(5deg); } }
.gemfall-screen { background: linear-gradient(#112433bb,#0b0f29ed), url('../assets/parallax/x_glowwood/composite.jpg') center/cover; }
.gem-score { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 14px 0; font-size: 20px; color: #ffe1a6; }
.gem-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; padding: 7px; border: 2px solid #7a7198; border-radius: 14px; background: #0d102cdd; }
.gem-cell { aspect-ratio: 1; min-width: 0; padding: 3px; border: 1px solid #5b5276; border-radius: 8px; background: #30354b; cursor: pointer; }
.gem-cell img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.gem-cell.chosen { outline: 3px solid #ffe08a; background: #665831; }
.gem-cell.matched { transform: scale(.65); opacity: .3; transition: transform .18s,opacity .18s; }
.gem-cell:disabled { opacity: 1; }
.gem-cell.matched:disabled { opacity: .3; }
.gemfall #gem-message { min-height: 40px; color: #ffe7aa; }
/* One-shot moves stop on the last occupied cell, never the blank cell after it. */
@keyframes av2-once-3 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 72) * var(--s)); } }
@keyframes av2-once-5 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 144) * var(--s)); } }
@keyframes av2-once-8 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 252) * var(--s)); } }
@keyframes av2-once-10 { from { background-position-x: calc(-1px * var(--wx) * var(--s)); } to { background-position-x: calc(-1px * (var(--wx) + 324) * var(--s)); } }
.monster.mflip { transform: scaleX(-1) !important; }

/* ---------- Look editor ---------- */
.lk { padding: 10px; }
.lk-preview { display: flex; align-items: center; gap: 10px; }
.lk-stage { flex: 1; display: grid; place-items: center; min-height: 170px; border-radius: 10px; background: radial-gradient(#3a2d22, #1b1510); border: 1px solid var(--line); }
.lk-side { display: flex; flex-direction: column; gap: 6px; }
.lk-tabs { padding: 10px 0 4px; }
.lk-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #2f251d; }
.lk-label { width: 82px; flex: none; font-size: 13px; color: var(--muted); }
.lk-step { display: flex; align-items: center; gap: 8px; }
.lk-step b { min-width: 64px; text-align: center; font-family: var(--pixel); font-size: 14px; }
.lk-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #120d09; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.sw.on { box-shadow: 0 0 0 3px var(--gold); }
.lk-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { background: #241c16; border: 1px solid var(--line); color: var(--ink); border-radius: 16px; padding: 5px 10px; font-size: 13px; }
.chip.on { background: var(--gold); color: #2a1a07; border-color: var(--gold); }
.create .lk { margin: 0 16px; }
.credits { padding: 6px 14px; display: flex; flex-direction: column; gap: 2px; }
.credit { padding: 8px 0; border-bottom: 1px solid #2c231b; }
.credit b { display: block; font-size: 14px; }
.credit span { display: block; color: #e2d5bf; font-size: 13px; }
.credit small { color: var(--muted); font-size: 12px; }
.credit a { color: var(--gold); }

/* ---------- Mini-games ---------- */
.mg-screen.solid { justify-content: flex-start; padding: 56px 14px 14px; overflow-y: auto; }
.mg-screen.solid::before { background: rgba(14,10,7,.82); }
.mg-body { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mg-help { font-size: 13px; color: #e2d5bf; margin: 0; text-align: center; }
.rw-grid { display: flex; flex-direction: column; gap: 5px; }
.rw-row { display: flex; gap: 5px; }
.rw-t { width: 46px; height: 46px; display: grid; place-items: center; font-family: var(--pixel); font-size: 24px; border: 2px solid var(--line); background: #1a140f; border-radius: 6px; }
.rw-t.typed { border-color: #8a7458; }
.rw-t.hit { background: #e0a82e; border-color: #f0c35c; color: #2a1a07; }
.rw-t.near { background: #aeb6bf; border-color: #d5dce3; color: #1d2228; }
.rw-t.no { background: #2b2521; color: #8a7f72; }
.kb-wrap { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.kb-row { display: flex; gap: 4px; justify-content: center; }
.kb { flex: 1; max-width: 34px; height: 42px; border-radius: 5px; border: 0; background: #4b3a2b; color: var(--ink); font-family: var(--pixel); font-size: 15px; padding: 0; }
.kb.wide { max-width: 56px; font-size: 12px; }
.kb.hit { background: #c9962e; color: #2a1a07; } .kb.near { background: #aeb6bf; color: #1d2228; } .kb.no { background: #231d18; color: #6d6358; }
.vr-info { display: flex; gap: 20px; font-size: 14px; }
.vr-grid { display: grid; grid-template-columns: repeat(6, 48px); gap: 3px; }
.vr-c { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; border: 1px solid #0e0a07; background: #3b3530; padding: 0; font-family: var(--pixel); font-size: 20px; }
.vr-c img { width: 32px; height: 32px; }
.vr-c.open { background: #1e1916; }
.vr-c.ore { background: #3b2c14; }
.vr-c.n1 { color: #9fd08a; } .vr-c.n2 { color: #e8c35a; } .vr-c.n3 { color: #f09050; } .vr-c.n4, .vr-c.n5 { color: #ff6f5a; }
.dice-opp, .dice-me { display: flex; flex-direction: column; align-items: center; gap: 6px; background: rgba(36,28,22,.9); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 240px; }
.dice-row { display: flex; gap: 10px; }
.die { width: 52px; height: 52px; background: #efe4cc; border: 3px solid #6b4f2e; border-radius: 10px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 6px; }
.die i { display: block; }
.die i.on { background: #2a1a07; border-radius: 50%; margin: 2px; }
.die.held { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,182,74,.5); transform: translateY(-4px); }

/* ---------- The road: story card ---------- */
.storycard { margin: 10px 14px 0; background: linear-gradient(#1f1812, #1a140f); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-height: 124px; }
.storylines { font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: 15px; line-height: 1.45; color: #efe3cc; }
.storylines.short .sl { opacity: .45; font-size: 14px; }
.sl { margin: 0 0 6px; transition: opacity .6s; }
.sl:last-child { margin-bottom: 0; }
.sl.new { animation: linein .7s ease-out; }
@keyframes linein { from { opacity: 0; transform: translateY(6px); } }
.sl.sys { font-family: var(--body); font-size: 13px; color: var(--muted); }
.sl.find { font-family: var(--body); font-size: 13px; color: #f3dca2; }
.sl.find b, .sl.sys b { color: var(--gold); font-weight: 600; }
.sl.ev { color: #ffd2b8; }
.sl.ref { font-style: italic; }
.sli { display: inline-block; vertical-align: -4px; margin-right: 6px; }
.sli .ico { width: 18px; height: 18px; }
.sli .itemico { width: 22px; height: 22px; padding: 2px; }
.sli .itemico img { width: 16px; height: 16px; }
.modebar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #33281f; font-size: 12px; color: var(--muted); }
.modebar span { flex: 1; }
.modebar .ico { width: 14px; height: 14px; vertical-align: -2px; }
.pending { margin-top: 6px; animation: popin .35s ease-out; }
@keyframes popin { from { opacity: 0; transform: scale(.97); } }
.pe-top { display: flex; gap: 12px; align-items: center; }
.pe-pic { flex: none; width: 60px; height: 60px; display: grid; place-items: center; background: #120d0a; border: 2px solid var(--gold2); border-radius: 10px; }
.pe-pic .thumb { max-width: 54px; max-height: 54px; }
.pe-rare .pe-pic { border-color: var(--purple); box-shadow: 0 0 12px rgba(167,123,224,.5); }
.pe-text { margin: 0; font-family: Georgia, 'Palatino Linotype', serif; font-size: 16px; line-height: 1.4; color: #fff3de; }
.pe-top small { color: var(--muted); font-size: 12px; }
.pe-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pe-btns .btn { flex: 1 1 30%; min-height: 40px; font-size: 14px; }
.banked { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.banked .ico { width: 14px; height: 14px; vertical-align: -2px; }
.foe-in-scene { position: absolute; right: 9%; z-index: 4; animation: foebob 1.2s ease-in-out infinite; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.scenefoe { height: 88px; width: auto; image-rendering: pixelated; }
@keyframes foebob { 50% { transform: translateY(-3px); } }
.v-travel .walker { transition: left .4s; }
.v-travel .scene:has(.foe-in-scene) .walker { left: 36%; }

/* ---------- Journeys ---------- */
.journey .jhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-family: var(--pixel); color: var(--gold); }
.journey .bar.road { margin: 0 0 8px; }
.journey p { margin: 6px 0 0; font-size: 12px; }
.jtally { display: flex; flex-wrap: wrap; gap: 12px; font-family: var(--pixel); font-size: 13px; }
.jtally .ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }
.jrep .jbig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 8px; }
.jrep .jbig div { background: #120d0a; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.jrep .jbig b { display: block; font-family: var(--pixel); font-size: 22px; color: var(--gold); }
.jrep .jbig small { color: var(--muted); font-size: 11px; }
.jitems { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.jitems span { display: flex; align-items: center; gap: 3px; font-family: var(--pixel); font-size: 13px; }
ul.plain { padding-left: 18px; margin: 8px 0; font-size: 14px; }
ul.plain li { margin: 3px 0; }
.rarenote { color: #d7b8ff; }
.journal { margin: 0 14px 14px; background: #1a140f; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-family: Georgia, 'Palatino Linotype', serif; font-size: 14px; }
.journal .sl { padding: 4px 0; border-bottom: 1px solid #2a2119; margin: 0; }
.row.waiting { margin: 10px 14px 0; width: calc(100% - 28px); border-color: var(--gold2); background: #2b2014; }
.row.waiting .evpic { width: 48px; display: grid; place-items: center; }

/* ---------- Fight ---------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 16px; }
.chips i { font-style: normal; font-size: 10px; background: rgba(0,0,0,.65); border: 1px solid #5a4632; padding: 0 5px; border-radius: 6px; }
.bar.res { height: 10px; }
.bar.res span { font-size: 9px; line-height: 8px; }
.bar.res.rage i { background: linear-gradient(#e5543a, #9c2615); }
.bar.res.focus i { background: linear-gradient(#f2b35a, #b36c1d); }
.bar.res.energy i { background: linear-gradient(#f6e46a, #b8a01e); }
.bar.res.mp i { background: linear-gradient(#77b4ee, #3a6fae); }
.factions { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 14px; background: #1b1510; max-height: 46%; overflow-y: auto; }
.fbasic { display: flex; gap: 6px; }
.fbasic .btn { flex: 1; }
.fskills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.factions .btn { flex-direction: column; min-height: 44px; padding: 5px 8px; line-height: 1.15; }
.factions .btn b { font-weight: 400; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.factions .btn b .ico { width: 16px; height: 16px; }
.factions .btn b .itemico { width: 18px; height: 18px; padding: 1px; }
.factions .btn b .itemico img { width: 14px; height: 14px; }
.factions .btn small { font-family: var(--body); font-size: 11px; opacity: .85; }
.factions .skill { background: linear-gradient(#5a4380, #3e2d5c); color: #fff; }
.factions .skill.off { opacity: .45; filter: grayscale(.6); }
.cost.rage { color: #ffb4a0; } .cost.focus { color: #ffd79a; } .cost.energy { color: #fff08a; } .cost.mp { color: #a8d0ff; }
.fres { text-align: center; padding: 4px 0 6px; font-size: 14px; }

/* ---------- Talents ---------- */
.tal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 14px 8px; }
.tal-head b { font-family: var(--pixel); font-size: 22px; }
.tal-head b.gold { color: var(--gold); }
.tal-head small { display: block; color: var(--muted); font-size: 12px; }
.ttabs { display: flex; gap: 6px; padding: 0 14px; }
.ttab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 6px 4px; color: var(--muted); }
.ttab img { width: 32px; height: 32px; image-rendering: pixelated; }
.ttab b { font-family: var(--pixel); font-weight: 400; font-size: 14px; color: var(--ink); }
.ttab small { font-size: 11px; }
.ttab.on { border-color: var(--gold); background: #2e2214; }
.ttab.on b { color: var(--gold); }
.trole { margin: 8px 14px 0; font-size: 13px; color: var(--muted); text-align: center; }
.tgrid { position: relative; display: grid; grid-template-columns: 22px repeat(4, 1fr); grid-auto-rows: 62px; gap: 8px 8px; margin: 10px 14px; padding: 10px 8px; background: radial-gradient(ellipse at top, #2a2018, #140f0b 75%); border: 1px solid var(--line); border-radius: 12px; }
.tier-lbl { grid-column: 1; align-self: center; text-align: center; font-family: var(--pixel); font-size: 12px; color: #6b5a47; }
.tier-lbl.open { color: var(--gold2); }
.tal { position: relative; z-index: 2; justify-self: center; align-self: center; width: 50px; height: 50px; display: grid; place-items: center; background: #0f0b08; border: 2px solid #3d3026; border-radius: 8px; padding: 0; }
.tal img { width: 32px; height: 32px; image-rendering: pixelated; }
.tal.active { border-radius: 50%; }
.tal em { position: absolute; right: -8px; bottom: -7px; font-style: normal; font-family: var(--pixel); font-size: 11px; line-height: 14px; background: #0b0806; border: 1px solid #3d3026; color: var(--muted); padding: 0 4px; border-radius: 6px; }
.tal.locked img, .tal.openrow img { filter: grayscale(1) brightness(.55); }
.tal.locked { opacity: .55; }
.tal.openrow { border-color: #54432f; }
.tal.can { border-color: var(--gold); animation: glow 1.6s infinite; }
.tal.can em { color: var(--gold); border-color: var(--gold2); }
.tal.part { border-color: var(--green); }
.tal.part em { color: #bfe8ae; border-color: var(--green); }
.tal.maxed { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,182,74,.25); }
.tal.maxed em { color: #2a1a07; background: var(--gold); border-color: var(--gold); }
.tal.other { opacity: .3; }
.tal.other img { filter: grayscale(1); }
.tal.orL::after { content: 'or'; position: absolute; right: -8px; top: 50%; transform: translate(100%, -50%); font-family: var(--pixel); font-size: 12px; color: var(--muted); width: 18px; text-align: center; }
.tarrow { position: absolute; width: 4px; margin-left: -2px; background: #3d3026; z-index: 1; border-radius: 2px; }
.tarrow::after { content: ''; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); border: 6px solid transparent; border-top: 7px solid #3d3026; border-bottom: 0; }
.tarrow.met { background: var(--gold2); }
.tarrow.met::after { border-top-color: var(--gold2); }
.tal.big { width: 56px; height: 56px; flex: none; }
.talsheet { display: flex; gap: 14px; align-items: flex-start; }
.talsheet p { margin: 0 0 6px; }
.reqs li.ok { color: #bfe8ae; }
.reqs li.no { color: #ffb49e; }
.reqs li.ok::marker { content: '✓  '; }
.reqs li.no::marker { content: '✗  '; }
.abils { padding: 6px 12px; }
.abil { padding: 7px 0; border-bottom: 1px solid #33281f; }
.abil:last-child { border-bottom: 0; }
.abil b { font-family: var(--pixel); font-weight: 400; color: var(--gold); margin-right: 6px; }
.abil .pill { margin-right: 4px; }
.abil small { display: block; color: var(--muted); margin-top: 2px; }
.pill.res-rage { background: #4d1f18; color: #ffb4a0; }
.pill.res-focus { background: #4d3614; color: #ffd79a; }
.pill.res-energy { background: #45401a; color: #fff08a; }
.pill.res-mp { background: #1c3350; color: #a8d0ff; }

/* ---------- Fishing ---------- */
.mg-top #flog { margin-left: auto; margin-right: 8px; min-height: 28px; }
.fishkg { font-family: var(--pixel); font-size: 28px; color: var(--gold); margin: 0; }
.mg-msg p.gold { color: var(--gold); }

/* ---------- Towns, bosses, boards, stories ---------- */
.healcard { display: flex; align-items: center; gap: 10px; }
.healcard > div { flex: 1; }
.healcard b { display: flex; align-items: center; gap: 6px; font-family: var(--pixel); font-weight: 400; color: var(--gold); }
.healcard b .ico { width: 18px; height: 18px; }
.healcard small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.bossme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; width: 100%; }
.bossme div { background: #120d0a; border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; text-align: center; }
.bossme b { display: block; font-family: var(--pixel); font-size: 17px; color: var(--gold); }
.bossme small { color: var(--muted); font-size: 11px; }
.bosscard .btn.big { width: 100%; }
.bosscard.past .boss { filter: grayscale(.7) brightness(.8); }
.fighter.foe .bossimg { width: 190px; max-width: 190px; max-height: 190px; }
.row.me { border-color: var(--gold); background: #2e2214; }
.row.tier.mine { border-color: var(--gold); background: #2e2214; }
.row.tier.mine b { color: var(--gold); }
.bar.thin { height: 12px; margin-top: 5px; }
.bar.thin span { font-size: 9px; line-height: 10px; }
.row.ach > div { flex: 1; min-width: 0; }
.stars { color: var(--gold); font-size: 16px; letter-spacing: 2px; }
p.stars { font-size: 26px; margin: 0 0 8px; }
.chainname { font-family: var(--pixel); color: var(--gold); font-size: 20px; margin: 0; }
.pe-chain .pe-btns .btn, .pe-choice .pe-btns .btn { flex-basis: 100%; min-height: 38px; font-family: var(--body); font-size: 14px; }

/* ---------- Gear, rarities ---------- */
body { font-synthesis: none; }
.itemico.r5 { border-color: #e0483a; box-shadow: 0 0 6px rgba(224,72,58,.5); } .itemico.r6 { border-color: #f3d36b; box-shadow: 0 0 8px rgba(243,211,107,.6); }
.rn.r0 { color: #d8d2c8; } .rn.r1 { color: #7fd06a; } .rn.r2 { color: #6aaaf0; } .rn.r3 { color: #c08cf5; } .rn.r4 { color: #f0a640; } .rn.r5 { color: #f0594a; } .rn.r6 { color: #f7d872; }
.rar.r5 { color: #f0594a; } .rar.r6 { color: #f7d872; }
.gname { font-family: var(--pixel); font-size: 20px; margin: 6px 0 2px; }
.gearcard .gstats { font-size: 15px; }
.gearcard .unique { background: #2b1414; border: 1px solid #7a2a20; border-radius: 8px; padding: 6px 10px; }
.gdrop { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; }
.jgear { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.jgear div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; text-align: center; }
.statgrid div { background: #120d0a; border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px; }
.statgrid b { display: block; font-family: var(--pixel); font-size: 18px; color: var(--gold); font-weight: 400; }
.statgrid small { color: var(--muted); font-size: 11px; }
.slot b.rn { font-size: 13px; }
.row .rn { font-weight: 600; }
.noc { color: #ff9a86; } .okc { color: #a8e295; }

/* ---------- Areas, bosses, activities ---------- */
.pin.locked i { background: #5c5249; border-color: #2a231d; }
.pin.locked span { opacity: .6; }
.pin.cleared i { box-shadow: 0 0 0 3px rgba(232,182,74,.45); }
.abosscard .abtop { display: flex; gap: 10px; align-items: center; }
.abosscard .abtop b { font-family: var(--pixel); font-weight: 400; color: #ffb49e; font-size: 16px; }
.abosscard .abtop small { display: block; color: var(--muted); font-size: 12px; }
.abosscard p { font-size: 14px; margin: 8px 0; }
.abosscard .btn { width: 100%; }
.abosscard.done { border-color: var(--gold2); }
.bar.energy i { background: linear-gradient(#8fe3e0, #3a9a96); }
.card.energy small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.row.prof > div, .row.job > div, .row.dung > div { flex: 1; min-width: 0; }
.stations .station.dim { opacity: .5; }
.drooms { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.droom { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2a211a; border: 2px solid var(--line); font-family: var(--pixel); }
.droom.on { border-color: var(--gold); color: var(--gold); }
.droom.done { background: #2f4d27; border-color: #4f8a3f; }
.droom.boss { border-radius: 6px; }
.dmsg { text-align: center; font-size: 14px; }
.dungeon .mg-msg .fightimg { width: 120px; height: 110px; }
.dungeon .btnrow { margin: 8px 0; }

/* ---------- Pets ---------- */
.petimg { image-rendering: pixelated; object-fit: contain; }
.petimg.pface { transform: scaleX(-1); }
.petimg.ghost { filter: grayscale(1) brightness(1.6); opacity: .55; }
.pet { position: absolute; pointer-events: none; }
.pet .petimg { height: 100%; width: auto; }
.walker .walkpet { left: -36px; bottom: 0; height: 46px; animation: petbob .5s ease-in-out infinite alternate; }
.fighter.me .fightpet { left: 4px; top: 66px; height: 42px; z-index: 2; }
.mapme .mappet { left: -18px; bottom: 2px; height: 22px; }
@keyframes petbob { to { transform: translateY(-2px); } }
.petbig { height: 64px; width: 64px; }
.petsm { height: 40px; width: 40px; }
.petdrop { height: 40px; width: 40px; }
.sli .sli-pet { height: 18px; width: 18px; vertical-align: -4px; }
.pettop { display: flex; gap: 12px; align-items: center; }
.pettop b { font-family: var(--pixel); font-weight: 400; font-size: 18px; }
.pettop small { display: block; color: var(--muted); font-size: 12px; }
.hearts { color: #e5584a; letter-spacing: 1px; font-size: 14px; }
.petbonus { font-family: var(--pixel); font-size: 18px; color: var(--gold); margin: 10px 0 4px; }
.petcard.ghosty { border-color: #6a7a8a; }
.row.petrow > div, .row.feedopt > div { flex: 1; min-width: 0; }

/* ---------- Drop rates, pet sprites ---------- */
table.rates { width: calc(100% - 28px); margin: 6px 14px 10px; border-collapse: collapse; font-size: 13px; }
table.rates th { text-align: left; font-family: var(--pixel); font-weight: 400; color: var(--gold); padding: 6px 6px; border-bottom: 1px solid var(--line); }
table.rates td { padding: 6px; border-bottom: 1px solid #2a2119; }
table.rates td + td, table.rates th + th { text-align: right; white-space: nowrap; }
.rates-wrap { overflow-x: auto; }
.rates-wrap table.rates { min-width: 520px; }
span.petimg { display: inline-block; width: 48px; height: 40px; background-size: 200% 100%; background-repeat: no-repeat; image-rendering: pixelated; animation: petframe .8s steps(1) infinite; flex: none; }
@keyframes petframe { 0% { background-position: 0 0; } 50% { background-position: 100% 0; } }
.pet span.petimg { width: 100%; height: 100%; }
.walker .walkpet { width: 55px; height: 46px; }
.fighter.me .fightpet { width: 50px; height: 42px; }
.mapme .mappet { width: 26px; height: 22px; }
span.petimg.petbig { width: 77px; height: 64px; }
span.petimg.petsm { width: 48px; height: 40px; }
span.petimg.petdrop { width: 48px; height: 40px; }
.sli span.sli-pet { width: 22px; height: 18px; vertical-align: -4px; }

/* Food and potions in fights */
.fbag { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; background: #120d09; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.brow { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: inherit; text-align: left; font: inherit; }
.brow .itemico { width: 30px; height: 30px; flex: none; } .brow .itemico img { width: 22px; height: 22px; }
.brow .binfo { flex: 1; display: flex; flex-direction: column; } .brow small { color: var(--muted); font-size: 11px; }
.brow em { font-style: normal; font-family: var(--pixel); font-size: 14px; }
.brow.off { opacity: .45; }
.fedline { display: flex; align-items: center; gap: 8px; color: #a8e08c; font-size: 13px; margin: 4px 0; }
.fedline .itemico { width: 26px; height: 26px; } .fedline .itemico img { width: 18px; height: 18px; }

/* Curios and the pantry */
.cset { margin: 8px 14px; }
.csethead, .csetfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.csetfoot { margin-top: 8px; } .csetfoot small { color: var(--muted); }
.cgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.cgrid.pantry { padding: 0 14px 14px; }
.curio { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 11px; line-height: 1.15; }
.curio .itemico { width: 40px; height: 40px; } .curio .itemico img { width: 28px; height: 28px; }
.curio:not(.found) .itemico img { filter: brightness(0) !important; opacity: .35; }
.curio:not(.found) b { opacity: .7; }
.curio small { color: var(--muted); font-size: 10px; }

/* Gathering mini-games */
.gath .mg-msg { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 320px; }
.gath .mg-msg .btn { width: 100%; }
.gstrike { display: grid; grid-template-columns: repeat(3, 84px); gap: 8px; }
.gs-c { position: relative; width: 84px; height: 84px; border-radius: 12px; background: #3b3530; border: 2px solid #0e0a07; padding: 0; display: grid; place-items: center; }
.gs-c img { grid-area: 1 / 1; width: 48px; height: 48px; }
.gs-c .ore { opacity: 0; transition: opacity .08s; }
.gs-c.lit { background: #5a4520; border-color: var(--gold); box-shadow: 0 0 14px rgba(240,190,80,.7); }
.gs-c.lit .ore { opacity: 1; }
.gs-c.hit { background: #2f5a24; } .gs-c.bad { background: #6a2420; }
.gpick { display: grid; grid-template-columns: repeat(4, 66px); gap: 6px; }
.gp-c { width: 66px; height: 66px; border-radius: 10px; background: #2c3a22; border: 2px solid #11160c; padding: 0; display: grid; place-items: center; }
.gp-c img { width: 40px; height: 40px; }
.gp-c.hit { background: #3e6a2c; opacity: .45; } .gp-c.bad { background: #6a2420; opacity: .45; }
.gbar { max-width: 340px; }
.fzone.inner { background: rgba(240,210,90,.9); }
.gmarks { letter-spacing: 2px; } .gm { font-style: normal; } .gm.m10 { color: var(--gold); } .gm.m7 { color: #9fd08a; } .gm.m3 { color: #c9b28a; } .gm.m0 { color: #777; }
.ggrade { font-family: var(--pixel); font-size: 26px; margin: 2px 0 !important; }
.ggrade.rough { color: #c9b28a; } .ggrade.good { color: #9fd08a; } .ggrade.great { color: #6aaaf0; } .ggrade.perfect { color: var(--gold); text-shadow: 0 0 8px rgba(240,190,80,.6); }
.statpts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 4px; font-size: 13px; }
.statpts .gold { color: var(--gold); }
#goalline .btn { margin-top: 2px; }
.mg-body.gath { flex: 1; justify-content: center; }

/* Shiny pets */
.shinywrap { position: relative; display: inline-block; line-height: 0; }
.pet .shinywrap { width: 100%; height: 100%; }
.spark { position: absolute; font-style: normal; font-size: 10px; line-height: 1; color: #fff6b0; text-shadow: 0 0 4px #ffe066; opacity: 0; animation: sparkle 2.4s infinite; pointer-events: none; }
.spark.s1 { top: -2px; left: 8%; } .spark.s2 { top: 30%; right: -4px; animation-delay: .8s; } .spark.s3 { bottom: 0; left: 40%; animation-delay: 1.6s; font-size: 8px; }
@keyframes sparkle { 0%, 70%, 100% { opacity: 0; transform: scale(.4); } 80% { opacity: 1; transform: scale(1.2); } 90% { opacity: .6; transform: scale(.8); } }
.pill.shinypill { background: linear-gradient(90deg, #f7d872, #fff6b0, #f7d872); color: #3a2a08; font-size: 10px; vertical-align: 2px; }

/* Daily login */
.hudgift { background: none; border: 0; padding: 0 2px; animation: giftbob 1.6s ease-in-out infinite; }
.hudgift .ico { width: 22px; height: 22px; }
@keyframes giftbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.loginstreak { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 8px 14px; }
.loginstreak b { display: block; font-family: var(--pixel); font-size: 24px; color: var(--gold); }
.loginstreak small { color: var(--muted); font-size: 11px; }
.logincal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 6px 14px; }
.lday { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 2px 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-height: 72px; }
.lday small { font-size: 10px; color: var(--muted); }
.lday .lico .ico, .lday .lico img { width: 24px; height: 24px; }
.lday em { font-style: normal; font-size: 9.5px; line-height: 1.15; }
.lday.big { border-color: #7a5a2a; background: #2a1f14; }
.lday.done { opacity: .45; }
.lday.today { border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(232,182,74,.45); opacity: 1; }
.ltick { position: absolute; top: 2px; right: 4px; font-style: normal; color: #7fd06a; font-size: 13px; }
.lnote { font-size: 13px; margin: 4px 0; }
.herotop .linkbtn { padding: 0; font-size: inherit; color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }

/* Quests */
.qtrack { display: flex; align-items: center; gap: 8px; width: calc(100% - 28px); margin: 0 14px 6px; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: inherit; text-align: left; font-size: 12.5px; line-height: 1.25; }
.qtrack .ico { width: 20px; height: 20px; flex: none; }
.qsteps { display: flex; flex-direction: column; gap: 6px; }
.qstep { border-left: 3px solid var(--line); padding: 4px 10px; }
.qstep p { margin: 2px 0; font-size: 13px; } .qstep small { color: var(--muted); }
.qstep.done { border-color: #5fae4e; opacity: .7; } .qstep.now { border-color: var(--gold); } .qstep.later { opacity: .5; }
.abosscard.locked { border-style: dashed; }
.wscard { margin: 0 14px 8px; width: calc(100% - 28px); }

/* Arena */
.arenafoe { display: flex; justify-content: center; align-items: flex-end; height: 110px; }
.arenafoe .av { transform: scaleX(-1); }
.arenarank { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 8px 14px; }
.arenarank small { display: block; color: var(--muted); font-size: 11px; } .arenarank b { font-family: var(--pixel); font-size: 18px; color: var(--gold); }
.arenarow .arenapic { width: 48px; height: 52px; display: grid; place-items: end center; overflow: hidden; flex: none; }
.arenarow .arenapic .av { transform: scaleX(-1); }
.arenarow.next { border-color: var(--gold); }
.btncol { display: flex; flex-direction: column; gap: 4px; }

/* Crafting games */
.forge { position: relative; width: 100%; max-width: 340px; height: 56px; background: #2a1d14; border: 3px solid #0a0a0a; border-radius: 8px; overflow: hidden; }
.fline { position: absolute; left: 85%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.fnote { position: absolute; top: 12px; width: 26px; height: 26px; margin-left: -13px; border-radius: 6px; background: #c9c2b8; border: 2px solid #3a3530; opacity: 0; }
.fnote.good { background: #7fd06a; } .fnote.meh { background: #e8c35a; }
.heatbar { position: relative; width: 60px; height: 220px; background: linear-gradient(#a33a20, #e0802c 50%, #2b3d5a); border: 3px solid #0a0a0a; border-radius: 10px; }
.hzone { position: absolute; left: 0; right: 0; background: rgba(111,210,90,.75); border-top: 2px solid #c8f5b0; border-bottom: 2px solid #c8f5b0; }
.hneedle { position: absolute; left: -10px; right: -10px; height: 4px; margin-bottom: -2px; background: #fff; box-shadow: 0 0 6px #fff; }
#chold.on { filter: brightness(1.2); transform: scale(.97); }

/* Territories */
.tpin { position: absolute; transform: translate(-50%, -100%); background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; z-index: 3; }
.tpin i { width: 14px; height: 18px; background: var(--tc); clip-path: polygon(0 0, 100% 15%, 0 55%); border-left: 2px solid #2a2016; }
.tpin span { font-family: var(--pixel); font-size: 8px; color: #fff; text-shadow: 0 1px 2px #000; }
.tpin.siege i { animation: flagpulse 1s infinite; }
@keyframes flagpulse { 50% { filter: brightness(1.8); } }
.tflag { flex: none; width: 42px; padding: 3px 0; text-align: center; border-radius: 4px; font-family: var(--pixel); font-size: 10px; color: #1b1510; }
.row.terr .bar { margin: 4px 0 2px; }

/* Step-free mode */
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #3a3128; border: 1px solid var(--line); flex: none; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #d8d2c8; transition: left .15s; }
.switch input:checked + span { background: #5fae4e; } .switch input:checked + span::after { left: 22px; }
.rhythm { margin: 8px 14px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.rh-top { display: flex; justify-content: space-between; align-items: center; }
.rh-stage { position: relative; height: 110px; overflow: hidden; }
.rh-target, .rh-ring { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; border-radius: 50%; transform: translate(-50%, -50%); }
.rh-target { border: 3px solid var(--gold); box-shadow: 0 0 10px rgba(232,182,74,.4); }
.rh-ring { border: 3px solid #fff6d8; }
.rh-feet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.rh-feet .ico { width: 30px; height: 30px; }
.rh-feet.hop { animation: hop .25s; }
@keyframes hop { 50% { transform: translate(-50%, -70%) scale(1.15); } }
.rh-info { display: flex; justify-content: space-between; font-size: 12.5px; }
#rhJudge.perfect { color: var(--gold); } #rhJudge.good { color: #9fd08a; } #rhJudge.miss { color: #e07a6a; }
.pvppic { display: grid; place-items: center; }
.pvppic .av { transform: scaleX(-1); }
.pin.pvpzone i { box-shadow: 0 0 0 3px #c0392b, 0 0 10px #c0392b; }
.myguard .abtop, .gtype { align-items: center; }
.gtype .thumb, .myguard .thumb { width: 56px; height: 56px; object-fit: contain; }
.gtype.on { border-color: var(--gold); }
.rh-modes { display: flex; gap: 4px; } .rh-modes .tab { padding: 4px 10px; font-size: 11px; }
.tapstep { position: relative; overflow: hidden; }
.tapstep i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.35); pointer-events: none; }
.tapstep span { position: relative; }
.tapstep.wait { filter: saturate(.6); }

/* Faction wings */
.wingshow { position: relative; display: inline-grid; place-items: center; }
.wingshow > .av, .wingshow > .hero-sprite { position: relative; z-index: 1; }
img.wings { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); image-rendering: pixelated; z-index: 0; pointer-events: none; }
img.wings.big { width: calc(84px + var(--wr) * 14px); }
img.wings.sm { width: calc(40px + var(--wr) * 5px); top: 38%; }
img.wings.xs { position: static; transform: none; width: calc(22px + var(--wr) * 3px); }
.wingpic { position: relative; }
.factop { text-align: center; } .factop .wingshow { margin: 4px auto 2px; min-height: 130px; }
.faccards { display: grid; gap: 10px; padding: 0 14px; }
.faccard { text-align: center; border-width: 2px; } .faccard .wingshow { min-height: 100px; margin: 0 auto; }
.ranks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 0 14px; }
.rk { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.rk small { margin-left: auto; color: var(--muted); } .rk.on { border-color: var(--gold); }
.warscore { display: flex; align-items: center; justify-content: space-around; text-align: center; }
.warscore b { display: block; font-family: var(--pixel); font-size: 30px; color: var(--gold); } .warscore small { color: var(--muted); }

/* ---------- Fight animations (code-only until the paper doll gets attack and hit frames) ---------- */
/* translate is used instead of transform so the mirrored hero and flipped monsters stay the right way round. */
.fighter { --fxd: 0s; }
.fighter.me.fx-atk .av { animation: fx-lunge-r .32s ease-out; }
.fighter.foe.fx-atk .monster, .fighter.foe.fx-atk .arenafoe { animation: fx-lunge-l .32s ease-out .38s backwards; }
.fighter.foe.fx-hurt .monster, .fighter.foe.fx-hurt .arenafoe { animation: fx-shake .3s linear .12s; }
.fighter.foe.fx-atk.fx-hurt .monster { animation: fx-shake .3s linear .12s, fx-lunge-l .32s ease-out .45s; }
.fighter.me.fx-hurt .av { animation: fx-shake .3s linear .5s; }
.fighter.me.fx-atk.fx-hurt .av { animation: fx-lunge-r .32s ease-out, fx-shake .3s linear .5s; }
.fighter.fx-hurt::after { content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 60%; border-radius: 50%; background: radial-gradient(rgba(255,60,40,.55), transparent 70%); opacity: 0; pointer-events: none; animation: fx-flash .35s ease-out .12s; }
.fighter.me.fx-hurt::after { animation-delay: .5s; }
.fighter.me.fx-heal::before { content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 60%; border-radius: 50%; background: radial-gradient(rgba(110,220,120,.5), transparent 70%); opacity: 0; pointer-events: none; animation: fx-flash .6s ease-out; }
.fighter.foe.fx-tell .monster { animation: fx-tell .5s ease-in-out 3; }
@keyframes fx-lunge-r { 40% { translate: 26px 0; } }
@keyframes fx-lunge-l { 40% { translate: -26px 0; } }
@keyframes fx-shake { 20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
@keyframes fx-flash { 30% { opacity: 1; } }
@keyframes fx-tell { 50% { translate: 0 -6px; scale: 1.06; } }
.fpop { position: absolute; top: 18%; left: 50%; z-index: 5; translate: -50% 0; font-family: var(--pixel); font-size: 18px; color: #ff6a5a; text-shadow: 0 2px 0 #000, 0 0 4px #000; pointer-events: none; opacity: 0; animation: fx-pop .9s ease-out .14s forwards; }
.fighter.me .fpop { animation-delay: .52s; }
.fpop.crit { font-size: 24px; color: #ffd34a; }
.fpop.heal { color: #7be08a; animation-delay: 0s; top: 30%; }
@keyframes fx-pop { 0% { opacity: 0; translate: -50% 6px; } 15% { opacity: 1; } 100% { opacity: 0; translate: -50% -34px; } }
.famline { display: block; font-size: 10px; color: #e9dcc3; text-shadow: 0 1px 2px #000; text-align: center; line-height: 1.2; }
.chips i.warn { background: rgba(140,30,20,.85); border-color: #e8b64a; color: #ffe9a8; animation: glow 1s infinite; }
.flog .hint { color: #ffd34a; font-family: var(--pixel); font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .fighter *, .fighter::after, .fighter::before, .fpop { animation: none !important; } .fpop { opacity: 1; } }
.beast .bweak, .beast .bmoves { display: block; font-size: 9px; line-height: 1.2; color: var(--muted); }
.beast .bmoves { color: #e8b64a; }
.ench, .gearcard .ench { color: #8fd4ff; }
.gearcard p.bind { font-size: 11px; color: var(--muted); }
.gearcard p.bind.char { color: #e8b64a; }
.gitem.bound { opacity: .55; }
.gitem em.lock { font-style: normal; font-size: 8px; background: rgba(0,0,0,.7); }
.craftbtns { display: flex; flex-direction: column; gap: 4px; flex: none; }
.stationup ul { margin: 6px 0; font-size: 12px; }
.stationup ul li::before { content: '· '; color: var(--gold); }

/* ---------- Forums, suggestions, art contest ---------- */
textarea, select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--line); background: #120e0b; color: var(--ink); outline: none; margin-top: 4px; font: inherit; resize: vertical; }
textarea:focus, select:focus { border-color: var(--gold2); }
.sheet-body label, .card label:not(.btn):not(.chk) { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
.fthead { padding: 6px 14px 0; } .fthead h2 { margin: 4px 0; font-size: 20px; } .fthead small { color: var(--muted); }
.fposts { display: flex; flex-direction: column; gap: 8px; padding: 8px 14px; }
.fpost { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.fpost.hidden { opacity: .6; font-style: italic; }
.fpby { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; } .fpby small { color: var(--muted); font-size: 11px; }
.fptext p { margin: 6px 0; line-height: 1.4; overflow-wrap: anywhere; }
.fpacts { display: flex; gap: 6px; justify-content: flex-end; }
.fpacts .btn.on { outline: none; color: #ff8fa0; }
.card textarea + .btn { margin-top: 8px; }
.modfold summary { color: var(--muted); font-size: 12px; cursor: pointer; margin: 8px 0; }
.sugg { padding: 0; overflow: hidden; }
.sugg .vote { flex: none; width: 54px; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #241c16; border: 0; border-right: 1px solid var(--line); color: var(--muted); font-family: var(--pixel); }
.sugg .vote.on { background: #4d3a14; color: var(--gold); }
.sugg .sbody { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: inherit; padding: 9px 10px; }
.sugg .sbody small { display: block; color: var(--muted); font-size: 12px; }
.devreply { border-left: 3px solid var(--gold); padding: 4px 10px; margin: 8px 0; background: rgba(232,182,74,.08); }
.artgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 14px; }
.artgrid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.artcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.artcard.voted { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.artcard.framed { border: 6px solid #6b4a26; border-radius: 4px; background: #1a130d; }
.artcard small { color: var(--muted); font-size: 11px; }
.artopen { background: none; border: 0; padding: 0; width: 100%; }
.artimg { width: 100%; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; background: #120e0b; border-radius: 6px; }
.artimg.big { width: 220px; max-width: 100%; }
.artimg.thumb { width: 48px; height: 48px; flex: none; }
.checks { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.chk input { margin-top: 2px; accent-color: var(--gold); }
.wide0 { width: 100%; }
.myguard .abtop { display: flex; gap: 10px; }
.myguard .abtop small { display: block; color: var(--muted); font-size: 12px; }
table.rates td + td { white-space: normal; }
table.rates td { overflow-wrap: anywhere; }

/* Characteristics, Spire and mastery */
.charrow { align-items: center; }
.charrow > div:first-child { flex: 1; min-width: 0; }
.charrow .btnrow { flex-shrink: 0; gap: 4px; }
.statgrid.wide { margin: 8px 12px; }
.statgrid.wide b { font-size: 15px; }
.spirecard .abtop { display: flex; gap: 10px; align-items: center; }
.spirecard .abtop b { font-family: var(--pixel); font-weight: 400; color: #c9a7ff; font-size: 16px; }
.spirecard small { display: block; color: var(--muted); }
.abil .mast { color: #c9b98f; }
.abil .mast .linkbtn { font-size: 12px; }

/* Black Spire leaderboards */
.spireboard .srank { width: 30px; flex-shrink: 0; font-family: var(--pixel); color: var(--gold); text-align: center; }
.spireboard .row.mine { border-color: var(--gold2); background: rgba(232,182,74,.08); }
.spireboard .row > div { flex: 1; min-width: 0; }

/* Safe town / wild area note on arrival */
.placenote { border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.placenote.safe { background: rgba(120,200,120,.12); border: 1px solid rgba(120,200,120,.35); }
.placenote.wild { background: rgba(255,140,110,.10); border: 1px solid rgba(255,140,110,.35); }

/* ---------- World settings: Bloodmoon and Apocalypse (js/worlds.js) ---------- */
/* A colour variant's tint arrives in --mt from UI.monsterImg, so outlines can add to it. */
.monster { filter: var(--mt, contrast(1)); }
.fightimg { filter: var(--mt, contrast(1)) drop-shadow(0 4px 3px rgba(0,0,0,.6)); }
body.world-bloodmoon::before { background: rgba(38,5,4,.8); }
body.world-apocalypse::before { background: rgba(10,2,2,.88); }
body.world-bloodmoon .scene::after, body.world-apocalypse .scene::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: multiply; background: rgba(215,40,30,.45); }
body.world-apocalypse .scene::after { background: linear-gradient(rgba(60,0,0,.75), rgba(140,10,10,.55)); }
body.world-bloodmoon .arrive-img, body.world-bloodmoon .mapinner > img { filter: sepia(.35) saturate(1.7) hue-rotate(-28deg) brightness(.82); }
body.world-apocalypse .arrive-img, body.world-apocalypse .mapinner > img { filter: sepia(.5) saturate(1.6) hue-rotate(-30deg) brightness(.5) contrast(1.15); }
body.world-bloodmoon .monster { filter: var(--mt, contrast(1)) drop-shadow(1px 0 0 #ff2a1a) drop-shadow(-1px 0 0 #ff2a1a) drop-shadow(0 1px 0 #ff2a1a) drop-shadow(0 -1px 0 #ff2a1a); }
body.world-bloodmoon .fightimg, body.world-bloodmoon .monster.boss { filter: var(--mt, contrast(1)) drop-shadow(2px 0 0 #ff2a1a) drop-shadow(-2px 0 0 #ff2a1a) drop-shadow(0 2px 0 #ff2a1a) drop-shadow(0 -2px 0 #ff2a1a) drop-shadow(0 4px 3px rgba(0,0,0,.6)); }
body.world-apocalypse .monster { filter: var(--mt, contrast(1)) drop-shadow(0 0 1px #000) drop-shadow(0 0 2px #000) drop-shadow(0 0 5px rgba(0,0,0,.95)) drop-shadow(0 0 9px rgba(110,0,0,.55)); }
body.world-apocalypse .fightimg, body.world-apocalypse .monster.boss { filter: var(--mt, contrast(1)) drop-shadow(0 0 2px #000) drop-shadow(0 0 4px #000) drop-shadow(0 0 9px rgba(0,0,0,.95)) drop-shadow(0 0 16px rgba(120,0,0,.6)); animation: apocglow 2.4s ease-in-out infinite; }
@keyframes apocglow { 50% { filter: var(--mt, contrast(1)) drop-shadow(0 0 3px #000) drop-shadow(0 0 6px #000) drop-shadow(0 0 12px rgba(0,0,0,.95)) drop-shadow(0 0 22px rgba(150,0,0,.7)); } }
body .beast:not(.found) img.monster, body .beast:not(.found) svg.monster { filter: brightness(0) !important; }
.worldtag { position: absolute; right: 8px; top: 8px; z-index: 5; font-family: var(--pixel); font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgba(90,0,0,.8); color: #ffd0c8; border: 1px solid #ff3a2a; }
.worldtag.w2 { background: rgba(0,0,0,.85); color: #ff5a4a; border-color: #000; box-shadow: 0 0 8px #000; }
.danger i.hot { color: #ff5a4a; font-style: normal; }
.worldcard.on { border-color: #ff3a2a; }
.worldcard.w1 b { color: #ff7a6a; }
.worldcard.w2 b { color: #ff4a3a; text-shadow: 0 0 4px #000; }

/* ---------- Road games (js/roadgames.js) ---------- */
.pursuit { margin: 8px 14px; padding: 8px 10px; border-radius: 10px; background: rgba(90,10,6,.85); border: 1px solid #ff5a4a; font-size: 13px; animation: pursuitpulse 1.6s ease-in-out infinite; }
.pursuit b { color: #ffd0c8; }
.pursuit .bar { height: 8px; margin-top: 6px; background: rgba(0,0,0,.5); border-radius: 4px; overflow: hidden; }
.pursuit .bar i { display: block; height: 100%; background: linear-gradient(90deg, #f0c04a, #8fd16a); transition: width .3s; }
@keyframes pursuitpulse { 50% { box-shadow: 0 0 12px rgba(255,60,40,.6); } }
.pshadow img { filter: brightness(0) drop-shadow(0 0 3px rgba(255,40,30,.6)) !important; }
.mg-screen.nightsky { background: radial-gradient(ellipse at 50% 20%, #1b2550, #070912 75%); }
.mg-screen.nightsky::before { background: none; }
.sky { position: relative; width: min(330px, 86vw); aspect-ratio: 1; border-radius: 14px; background: radial-gradient(circle at 40% 30%, #16204a, #05070f); overflow: hidden; border: 1px solid #2c3a70; transition: filter .8s; }
.sky.cloudy { filter: blur(3px) brightness(.6); }
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky line { stroke: rgba(170,200,255,.75); stroke-width: .7; stroke-linecap: round; }
.sky .dust { position: absolute; width: 1px; height: 1px; background: rgba(255,255,255,.45); }
.sky .star { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 0; background: radial-gradient(circle, #fff 0 2px, rgba(200,215,255,.35) 3px, transparent 7px); border-radius: 50%; padding: 0; }
.sky .star.on { background: radial-gradient(circle, #fff 0 3px, rgba(255,235,160,.7) 4px, transparent 11px); }
.sky .star.first { animation: starpulse 1s ease-in-out infinite; }
.sky .star.bad { background: radial-gradient(circle, #ff8a7a 0 3px, rgba(255,80,60,.5) 4px, transparent 10px); }
@keyframes starpulse { 50% { transform: scale(1.35); } }
.lore { font-style: italic; color: #d8c38f; }
.lock { display: flex; gap: 10px; justify-content: center; padding: 14px; background: rgba(30,24,18,.9); border: 2px solid #8a6a3a; border-radius: 12px; }
.lock .lpin { position: relative; width: 28px; height: 150px; border-radius: 6px; background: linear-gradient(#2a221a, #14100c); border: 1px solid #5a4630; }
.lock .lpin .lptip { position: absolute; left: 3px; right: 3px; height: 16px; margin-bottom: -8px; border-radius: 4px; background: #8a8a8a; --near: 0; box-shadow: 0 0 calc(var(--near) * 14px) rgba(255,200,80,calc(var(--near))); }
.lock .lpin.cur .lptip { background: color-mix(in srgb, #9a9a9a, #f0c04a calc(var(--near) * 60%)); }
.lock .lpin .lptip.sweet { background: #ffd34a !important; box-shadow: 0 0 14px #ffd34a; }
.lock .lpin.set .lptip { background: #8fd16a; }
.lpmsg { text-align: center; font-family: var(--pixel); }
/* Herbalist's Satchel (js/gathering.js) */
.gsatchel { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; justify-content: center; transition: filter .4s; }
.gsc { width: 64px; height: 64px; border-radius: 10px; border: 2px solid #3c5a2a; background: repeating-linear-gradient(45deg, #2f4a22 0 6px, #36552a 6px 12px); padding: 0; transition: transform .15s; }
.gsc img { width: 36px; height: 36px; visibility: hidden; }
.gsc.up, .gsc.got { background: #e9dfc0; transform: rotateY(0); }
.gsc.up img, .gsc.got img { visibility: visible; }
.gsc.got { opacity: .55; border-color: #8fd16a; }
.gsc.bad { border-color: #ff5a4a; }
.wilt { width: min(300px, 80vw); height: 6px; margin: 10px auto 0; background: rgba(0,0,0,.5); border-radius: 3px; overflow: hidden; }
.wilt i { display: block; height: 100%; background: linear-gradient(90deg, #a07a3a, #8fd16a); }
/* Turtle Derby (js/turtles.js) */
/* The picture is two frames side by side. Sizes are in %, so a turtle of any size steps exactly one frame: the walk
   used to move 22px whatever the size, which slid the racing (33px) turtles two thirds of the way out of their frame. */
.turtle { display: inline-block; width: 22px; height: 12px; background: url(../assets/sprites/derby/turtle.png) 0 0 / 200% 100%; image-rendering: pixelated; vertical-align: middle; }
.turtle.walk { animation: turtlewalk .5s steps(2) infinite; }
.turtle.big { width: 66px; height: 36px; }
.turtle.big.walk { animation-name: turtlewalkbig; }
@keyframes turtlewalk { to { background-position: 200% 0; } }
@keyframes turtlewalkbig { to { background-position: 200% 0; } }
.turtlecard .abtop b, .turtlecard .abtop small { display: block; }
.turtlecard .abtop { align-items: center; gap: 12px; }
.turtlecard .tstat { display: grid; grid-template-columns: 70px 1fr 30px; gap: 8px; align-items: center; margin: 4px 0; font-size: 13px; }
.turtlecard .tstat .bar { margin: 0; }
#tName { width: 100%; margin: 8px 0; }
.dtrack { position: relative; width: min(360px, 92vw); background: #6b8a3a; border: 2px solid #3e5222; border-radius: 10px; padding: 4px 0; }
.dtrack .lane { position: relative; height: 30px; border-bottom: 1px dashed rgba(255,255,255,.25); }
.dtrack .lane small { position: absolute; left: 4px; top: 1px; font-size: 9px; color: rgba(255,255,255,.75); }
.dtrack .lane.me { background: rgba(255,211,74,.18); }
.dtrack .runner { position: absolute; bottom: 2px; transition: left .6s linear; }
.dtrack .runner .turtle { width: 33px; height: 18px; }
.dtrack .finish { position: absolute; top: 0; bottom: 0; right: 8px; width: 4px; background: repeating-linear-gradient(#fff 0 4px, #000 4px 8px); }
.derbylog { min-height: 2.6em; text-align: center; font-size: 13px; max-width: 340px; }
.derbyres { background: rgba(20,14,10,.85); border-radius: 10px; padding: 8px 8px 8px 30px; margin: 0; font-size: 13px; }
.derbyres li.me b { color: #ffd34a; }
/* Caravan Route (js/caravan.js) */
.cmap { position: relative; width: 100%; aspect-ratio: 4096 / 2160; background: url(../assets/map/world_map_hd.jpg) center / 100% 100%; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.cmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cmap polyline { fill: none; stroke-width: .9; stroke-dasharray: 2 1.2; opacity: .85; }
.cmap polyline.mine { stroke-width: 1.8; stroke-dasharray: none; opacity: 1; }
.cmap .cdot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 3px #000; }
.cmap .clabel { position: absolute; transform: translate(-50%, 4px); font-size: 9px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }
.cmap .cmark { position: absolute; transform: translate(-50%, -110%); }
.croute.on { border-color: #ffd34a; }

/* ---------- Gold and Diamond Chests (js/gemchests.js) ---------- */
.gchest b { display: flex; align-items: center; gap: 6px; }
.qmark { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; color: var(--gold); font-family: var(--pixel); font-size: 13px; line-height: 1; padding: 0; }
.gcodds table.rates { width: 100%; margin: 6px 0 12px; }
.gcodds table.rates td:nth-child(3) { text-align: left; color: var(--muted); font-size: 12px; }
.gcodds h4 { margin: 10px 0 2px; }
.pad0 { padding: 0 14px; }
.gchest-open { display: flex; justify-content: center; padding: 6px 0 10px; }
.gcbig { width: 96px; height: 96px; image-rendering: pixelated; animation: gcshake .45s ease-in-out 1, gcpop .3s ease-out .45s 1; }
@keyframes gcshake { 25% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-5deg); } }
@keyframes gcpop { 50% { transform: scale(1.18); filter: brightness(1.6); } }
.gcprizes .row { opacity: 0; animation: gcin .35s ease-out forwards; }
@keyframes gcin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lbperiod { font-size: 12px; color: var(--muted); margin: 4px 0; }

/* Guilds (js/guilds.js), habits, bank gold, the pursuit banner's fight button */
.gcolours { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.gcol { width: 30px; height: 30px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.gcol.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg) inset; }
.sheet select.inp, .sheet input.inp { width: 100%; box-sizing: border-box; }
.phead h2 .tflag { display: inline-block; width: auto; padding: 3px 6px; vertical-align: middle; margin-right: 4px; }
.sheet-head h3 .tflag { display: inline-block; width: auto; padding: 2px 6px; margin-right: 4px; }
.habitrow { display: flex; align-items: center; gap: 8px; }
.habitrow .tick { flex: 1; }
.habitrow .x.sm { font-size: 18px; line-height: 1; padding: 2px 8px; }
.bankgold p { margin: 0 0 8px; }
.pursuit #pursuitFight { margin-top: 8px; }

/* Cosmetics (js/cosmetics.js): profile frames, chat badges, titles, faction cloaks, guild hall */
.pfwrap { display: inline-grid; place-items: center; position: relative; }
.pframe { border-radius: 10px; padding: 2px; }
.pf-frame_oak { border: 3px solid #8a5a2b; box-shadow: inset 0 0 0 1px #c08a4a; }
.pf-frame_silver { border: 3px solid #c8ced6; box-shadow: 0 0 0 1px #6c7480, inset 0 0 0 1px #f4f6f8; }
.pf-frame_gold { border: 3px solid #e8b64a; box-shadow: 0 0 6px #e8b64a88, inset 0 0 0 1px #fff1c0; }
.pf-frame_ember { border: 3px solid #e0603a; box-shadow: 0 0 8px #ff7a3a99; }
.pf-frame_frost { border: 3px solid #8fd0f0; box-shadow: 0 0 8px #8fd0f099; }
.pf-frame_founder { border: 3px double #a98be0; box-shadow: 0 0 0 2px #2b2140, 0 0 8px #a98be088; }
.pf-frame_walker { border: 3px dashed #7fd06a; }
.hud-who .pframe { border-width: 2px; padding: 0; }
img.cbadge { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; image-rendering: pixelated; }
.ctitle { color: var(--muted); font-weight: normal; }
.cswatch { font-size: 18px; width: 32px; text-align: center; }
.chip { background: var(--panel2); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 2px 8px; margin: 2px 2px 0 0; font-size: 12px; }
.chip.on { border-color: var(--gold); color: var(--gold); }
.wardtop { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
img.cloakimg { position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%); image-rendering: pixelated; z-index: 0; pointer-events: none; }
img.cloakimg.big { width: 120px; top: 60%; }
img.cloakimg.xs { position: static; transform: none; width: 18px; }
.wingshow img.cloakimg { z-index: 0; }
img.gbanner { width: 22px; height: 22px; vertical-align: -3px; margin-right: 6px; image-rendering: pixelated; }

/* The road line across the top of the scene (game.js roadLineHTML) */
.roadline { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: flex-start; gap: 6px; padding: 7px 8px 8px 12px; background: linear-gradient(rgba(14,10,7,.88), rgba(14,10,7,.72)); border-bottom: 1px solid rgba(232,182,74,.25); cursor: pointer; }
.roadline.hidden { display: none; }
.roadline .sl { flex: 1; margin: 0; font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: 14px; line-height: 1.35; color: #efe3cc; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.roadline .sl.sys, .roadline .sl.find { font-family: var(--body); font-size: 13px; }
.roadline .sl.find { color: #f3dca2; } .roadline .sl.sys { color: var(--muted); } .roadline .sl.ev { color: #ffd2b8; }
.roadline .rlx { flex: none; background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.roadline.new { animation: linein .5s ease-out; }
.roadline .sl { min-width: 0; overflow-wrap: anywhere; }
.craft-game .craft-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 340px; }
.craft-game .craft-choices.rune-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.craft-game .craft-choices .btn { min-width: 0; min-height: 48px; white-space: normal; }
.craft-game .mg-body { text-align: center; }
.craft-game .mg-top { z-index: 1; gap: 8px; }
.craft-game .mg-top b { font-size: 14px; }
.storycard.bare { background: none; border: 0; padding: 0; min-height: 0; margin-top: 10px; }
.storycard.bare:empty { display: none; }
.roadtools { display: flex; gap: 14px; justify-content: flex-end; padding: 2px 14px 0; font-size: 12px; }

/* Keep filtered rows and inactive actions hidden even when their component sets display. */
[hidden] { display: none !important; }

/* Hardcore "Coming soon" card on character creation */
.modecard.soon { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.soonpill { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #3a2c1c; border: 1px solid var(--gold); color: var(--gold); font-family: var(--body, inherit); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }

/* Talent rows: the points needed to open the row, and under it the cost of one rank there */
.tier-lbl small { display: block; margin-top: 2px; font-family: var(--body, inherit); font-size: 9px; line-height: 1; color: #8a765e; white-space: nowrap; }
.tier-lbl.open small { color: var(--gold2); opacity: .8; }

/* Year-long login calendar */
.lmonth { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 14px 0; }
.lmonth b { font-family: var(--pixel); font-size: 15px; color: var(--gold); text-align: center; }
.lmonth b small { display: block; font-family: var(--body, inherit); font-size: 11px; color: var(--muted); }
.lday.mile { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(232,182,74,.35); }
.lmiles .lico { flex: none; width: 34px; text-align: center; }
.lmiles .lico img { width: 28px; height: 28px; }

/* Professions that are listed but not available yet (Engineering) */
.pill.soon { border-color: var(--gold); color: var(--gold); background: #3a2c1c; white-space: nowrap; }

/* Crafting games: live countdown, and the Tailoring loom */
.craft-clock { font-variant-numeric: tabular-nums; }
.craft-clock.low { color: #ff8a70; }
.loom { position: relative; width: 100%; max-width: 340px; height: 64px; border: 3px solid #0a0a0a; border-radius: 8px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #3a2b1e 0 3px, #2a1d14 3px 10px); }
.loom-gap { position: absolute; top: 0; bottom: 0; background: rgba(127, 208, 106, .38); border-left: 2px solid #7fd06a; border-right: 2px solid #7fd06a; }
.loom-shuttle { position: absolute; top: 20px; width: 22px; height: 20px; margin-left: -11px; border-radius: 10px / 8px; background: #e8c35a; border: 2px solid #3a3530; box-shadow: 0 0 6px rgba(232, 195, 90, .6); }
.loom-shuttle.hit { background: #7fd06a; } .loom-shuttle.miss { background: #d0604a; }

/* Bags: the strip of bag slots at the top of the Inventory screen */
.bagstrip { padding: 10px 12px; }
.bagstrip-top { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.bagstrip-top small { color: var(--muted); font-size: 12px; }
.bagstrip-top small b { color: var(--gold); }
.bagslots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bagslot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: inherit; font: inherit; cursor: pointer; }
.bagslot.empty { border-style: dashed; opacity: .75; }
.bagslot em { font-style: normal; font-size: 11px; color: var(--gold2); font-family: var(--pixel); }
.bagslot.empty em { color: var(--muted); font-family: inherit; }
.bagstrip .fine { margin: 8px 0 0; }
