* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #10131c; overflow: hidden; font-family: "Trebuchet MS", "Segoe UI", sans-serif; color: #3a2a22; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; left: 50%; top: 50%; width: var(--sw, 1280px); height: 720px; transform-origin: 0 0; overflow: hidden; background: #000; }
#c { position: absolute; inset: 0; width: var(--sw, 1280px); height: 720px; display: block; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
kbd { font: 11px ui-monospace, Menlo, monospace; background: rgba(0,0,0,.18); border-radius: 4px; padding: 0 4px; margin-left: 3px; }

/* screens */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(#3d9cf0, #c8ecff 70%, #f6e7b4); z-index: 20; }
.logo { display: flex; flex-direction: column; align-items: center; transform: rotate(-3deg); }
.logo .r { font-size: 120px; font-weight: 900; letter-spacing: 2px; color: #ffd84a; -webkit-text-stroke: 5px #3a2a22; paint-order: stroke fill; text-shadow: 0 8px 0 #c9603f, 0 12px 0 #3a2a22; }
.sub { font-size: 20px; color: #24405c; margin: 34px 0 6px; font-weight: bold; }
#status { font-size: 16px; color: #24405c; }

.panel { background: #f6ecd2; border: 3px solid #3a2a22; border-radius: 14px; box-shadow: 0 6px 0 rgba(58,42,34,.55); }
.creator { width: 860px; padding: 18px 26px 14px; }
.creator h2 { margin: 0 0 10px; font-size: 26px; }
.cols { display: flex; gap: 22px; }
.preview { width: 240px; height: 280px; border: 3px solid #3a2a22; border-radius: 12px; background: linear-gradient(#8fd0ff, #e9f7ff 65%, #e6d3ab 65%); }
.opts { flex: 1; display: grid; grid-template-columns: 96px 1fr; gap: 7px 10px; align-items: center; font-size: 14px; }
.opts label { font-weight: bold; }
.opts .muted { color: #8a7a66; font-size: 12.5px; line-height: 1.35; }
.sw { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sw button { width: 26px; height: 26px; border-radius: 7px; border: 2px solid #3a2a22; padding: 0; }
.sw button.on { outline: 3px solid #ff7a2e; outline-offset: 1px; }
.sw button.txt { width: auto; padding: 0 10px; background: #fff; font-size: 13px; }
.sw input[type=color] { width: 30px; height: 28px; padding: 0; border: 2px solid #3a2a22; border-radius: 7px; background: none; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.row label { font-weight: bold; }
.row input, #chatin { font: inherit; font-size: 16px; padding: 7px 10px; border: 2px solid #3a2a22; border-radius: 8px; background: #fff; user-select: text; -webkit-user-select: text; }
.primary { background: #ffb02e; border: 3px solid #3a2a22; border-radius: 10px; padding: 8px 20px; font-weight: bold; font-size: 17px; box-shadow: 0 3px 0 #3a2a22; }
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a2a22; }
#cerr { color: #b0352a; min-height: 18px; margin: 8px 0 0; font-weight: bold; }
#cback { font-size: 14px; vertical-align: middle; margin-right: 6px; }
.err { color: #b0352a; min-height: 20px; margin: 10px 0 0; font-weight: bold; font-size: 14.5px; }
.muted { color: #8a7a66; }

/* sign in */
.logo.small { transform: rotate(-3deg) scale(.62); margin: -31px 0 -17px; }
.authp { width: 470px; padding: 0 26px 16px; overflow: hidden; }
.authp .tabs { display: flex; margin: 0 -26px 16px; border-bottom: 3px solid #3a2a22; }
.authp .tabs button { flex: 1; padding: 11px; border: 0; background: #e2d3ae; font-weight: bold; font-size: 16px; color: #6a5a46; }
.authp .tabs button + button { border-left: 3px solid #3a2a22; }
.authp .tabs button.on { background: #f6ecd2; color: #3a2a22; }
#authf { display: grid; grid-template-columns: 1fr; gap: 5px; }
#authf label { font-weight: bold; font-size: 14px; margin-top: 6px; }
#authf input { font: inherit; font-size: 16px; padding: 8px 10px; border: 2px solid #3a2a22; border-radius: 8px; background: #fff; user-select: text; -webkit-user-select: text; }
#authf input:focus { outline: 3px solid #ffb02e; outline-offset: 0; }
#authf .primary { margin-top: 12px; }
.authp .muted { font-size: 12.5px; margin: 4px 0 10px; }
.authp .ahead { margin: 16px 0 4px; font-size: 22px; }
.authp .linkb { border: 0; background: none; color: #6a5a46; text-decoration: underline; font-size: 13.5px; padding: 0; margin: 2px 0 6px; }
.err.ok { color: #2f7a45; }

/* character slots */
.charsp { width: 980px; padding: 16px 24px 14px; }
.chead { display: flex; align-items: baseline; gap: 14px; }
.chead h2 { margin: 0; font-size: 26px; }
.chead .btn { margin-left: auto; }
.cslots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
.cslot { display: flex; flex-direction: column; align-items: center; gap: 3px; background: #fffaf0; border: 3px solid #3a2a22; border-radius: 12px; padding: 10px 10px 12px; min-height: 360px; }
.cslot canvas { width: 180px; height: 190px; border: 2px solid #3a2a22; border-radius: 10px; background: linear-gradient(#8fd0ff, #e9f7ff 72%, #e6d3ab 72%); cursor: pointer; }
.cslot .cn { font-size: 20px; margin-top: 4px; }
.cslot .cl { font-weight: bold; font-size: 14px; }
.cslot .cm { font-size: 13px; color: #8a7a66; margin-bottom: 8px; }
.cslot .primary { min-width: 140px; }
.cslot .linkb { border: 0; background: none; color: #8a7a66; text-decoration: underline; font-size: 13px; margin-top: 6px; }
.cslot input { font: inherit; font-size: 15px; padding: 6px 8px; border: 2px solid #3a2a22; border-radius: 8px; width: 160px; user-select: text; -webkit-user-select: text; }
.cslot .muted { font-size: 13px; text-align: center; margin: 2px 0 4px; }
.cslot .sbtns { display: flex; gap: 6px; margin-top: 6px; }
.btn.danger { background: #e0523f; color: #fff; }
.cslot.empty { justify-content: center; border-style: dashed; background: rgba(255,250,240,.5); }
.newc { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; font-weight: bold; font-size: 16px; color: #3a2a22; }
.newc b { width: 64px; height: 64px; border: 3px solid #3a2a22; border-radius: 50%; background: #ffb02e; font-size: 40px; line-height: 54px; }

/* hud */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#mapname { position: absolute; left: 14px; top: 12px; background: rgba(30,36,52,.82); color: #fff; border: 2px solid #fff; border-radius: 10px; padding: 5px 14px; font-weight: bold; font-size: 16px; pointer-events: none; }
#mapname small { display: block; font-weight: normal; font-size: 12px; color: #ffe08a; }
#mm { position: absolute; right: 12px; top: 10px; padding: 5px; background: rgba(30,36,52,.72); border: 2px solid #fff; border-radius: 10px; pointer-events: none; line-height: 0; }
#buffs { position: absolute; right: 232px; top: 12px; display: flex; gap: 6px; pointer-events: none; }
#buffs div { background: rgba(30,36,52,.82); color: #fff; border-radius: 8px; padding: 4px 9px; font-size: 13px; border: 2px solid #9fe07a; }
#chatlog { position: absolute; left: 12px; bottom: 62px; width: 430px; max-height: 118px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 13.5px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none; }
#chatlog p { margin: 1px 0; background: rgba(20,24,36,.42); padding: 1px 7px; border-radius: 6px; align-self: flex-start; }
#chatlog .good { color: #b8ff9a; } #chatlog .bad { color: #ffaa9a; } #chatlog .sys { color: #ffe08a; } #chatlog b { color: #9fd8ff; }
#hud.typing #chatlog { bottom: 96px; }
#chatin { position: absolute; left: 12px; bottom: 62px; width: 430px; font-size: 14px; padding: 5px 9px; }
#bar { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(#4a5470, #2c3348); border-top: 3px solid #1c2030; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: #fff; }
#lvl { background: #ffb02e; color: #3a2a22; border: 2px solid #1c2030; border-radius: 9px; padding: 2px 9px; font-size: 12px; text-align: center; line-height: 1.05; }
#lvl b { display: block; font-size: 20px; }
#who { min-width: 110px; line-height: 1.15; } #who b { display: block; font-size: 15px; } #who i { font-size: 12px; color: #ffe08a; font-style: normal; }
.gauge { position: relative; height: 22px; flex: 1; max-width: 190px; background: #1c2030; border: 2px solid #11141f; border-radius: 7px; overflow: hidden; }
.gauge div { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; transition: width .2s; }
.gauge span { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 18px; font-weight: bold; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.gauge.exp span { display: flex; justify-content: center; gap: 5px; padding: 0 6px; }
.gauge.exp span i { font-style: normal; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gauge.exp span b { flex: none; color: #fff4b8; }
.gauge.hp div { background: linear-gradient(#ff7a6a, #d9352a); } .gauge.mp div { background: linear-gradient(#6ab8ff, #2a6fd9); } .gauge.exp div { background: linear-gradient(#ffe86a, #e0a820); }
.gauge.exp { max-width: 260px; }
#btns { margin-left: auto; display: flex; gap: 5px; }
#btns button { background: #f6ecd2; border: 2px solid #1c2030; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; font-weight: bold; color: #3a2a22; }
#btns button:hover { background: #fff; }
#toast { position: absolute; left: 50%; top: 86px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
#toast div { background: rgba(30,36,52,.86); color: #fff; padding: 5px 14px; border-radius: 9px; font-size: 14px; animation: fade 3.2s forwards; }
@keyframes fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* windows */
.win { position: absolute; background: linear-gradient(#fdf6e4, #f3e5c3); border: 3px solid #3a2a22; border-radius: 14px; box-shadow: 0 5px 0 rgba(58,42,34,.55), 0 16px 34px rgba(10,12,20,.35); font-size: 14px; }
.win h3 span { flex: 1; text-shadow: 0 2px 0 rgba(0,0,0,.35); letter-spacing: .3px; }
.win h3 { margin: 0; padding: 7px 10px 7px 12px; background: linear-gradient(#66739a, #434d6b 55%, #3a4360); color: #fff; border-radius: 10px 10px 0 0; border-bottom: 3px solid #3a2a22; box-shadow: inset 0 2px 0 rgba(255,255,255,.22); font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.win h3 > i { font-style: normal; width: 28px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 16px; background: #f6ecd2; border: 2px solid #3a2a22; border-radius: 50%; margin: -4px 0; }
.win h3 button { background: linear-gradient(#ef6a55, #c9412f); color: #fff; border: 2px solid #3a2a22; border-radius: 8px; width: 28px; height: 26px; line-height: 18px; font-weight: bold; font-size: 17px; padding: 0; box-shadow: 0 2px 0 #3a2a22; }
.win h3 button:hover { filter: brightness(1.1); }
.win .body { padding: 10px 14px 14px; }
.win table { width: 100%; border-collapse: collapse; } .win td { padding: 3px 4px; }
.win .plus { background: linear-gradient(#ffc75a, #ff9f1a); border: 2px solid #3a2a22; border-radius: 7px; width: 26px; height: 24px; font-weight: bold; line-height: 14px; padding: 0; box-shadow: 0 2px 0 #3a2a22; }
.win .plus:active { transform: translateY(2px); box-shadow: none; }
.win .muted { color: #8a7a66; font-size: 12.5px; }
.btn { background: linear-gradient(#ffc75a, #ffa821); border: 2px solid #3a2a22; border-radius: 9px; padding: 4px 12px; font-weight: bold; font-size: 13.5px; box-shadow: 0 2px 0 #3a2a22; color: #3a2a22; }
.btn:hover:not(:disabled) { filter: brightness(1.06); } .btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.btn.alt { background: linear-gradient(#fff, #f1e8d2); } .btn:disabled { opacity: .45; cursor: default; }
#w-stats { left: 20px; top: 64px; width: 340px; }
#w-items { right: 20px; top: 60px; width: 340px; }
#w-skills { left: 380px; top: 64px; width: 390px; }
#w-quests { left: 20px; top: 64px; width: 720px; }
#w-help { left: 400px; top: 150px; width: 480px; }
#w-wmap { left: 190px; top: 18px; width: 900px; }
#w-wmap canvas { display: block; width: 870px; height: 580px; border-radius: 8px; border: 2px solid #3a2a22; }
#w-wmap .wmbar { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
#w-wmap .wmbar button { background: #f6ecd2; border: 2px solid #3a2a22; border-radius: 8px; padding: 3px 10px; font: inherit; color: #3a2a22; cursor: pointer; }
#w-wmap .wmbar button.on { background: #ffd84a; font-weight: bold; }
#w-wmap .wmbar span { color: #8a7a66; }
#w-wmap .wmbar em { margin-left: auto; color: #8a7a66; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(6, 44px); gap: 5px; margin-top: 8px; }
.slot { width: 44px; height: 44px; background: linear-gradient(#efe3c2, #e2d1a6); border: 2px solid #b9a67a; border-radius: 9px; box-shadow: inset 0 2px 3px rgba(58,42,34,.18); position: relative; display: flex; align-items: center; justify-content: center; font-size: 25px; cursor: pointer; }
.slot:hover { border-color: #ff7a2e; background: #fff3d2; }
.slot i { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-style: normal; font-weight: bold; color: #3a2a22; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.slot img { width: 36px; height: 36px; object-fit: contain; }
.equip { display: flex; gap: 14px; align-items: center; } .equip .slot { background: linear-gradient(#e2ecf6, #c9d8ea); border-color: #8aa0b8; }
.equip span { font-size: 11px; text-align: center; display: block; color: #6a5a46; font-weight: bold; margin-top: 3px; }
.coins { margin-top: 8px; font-weight: bold; }
#tip { position: absolute; z-index: 40; pointer-events: none; background: rgba(30,36,52,.95); color: #fff; border: 2px solid #fff; border-radius: 9px; padding: 7px 10px; font-size: 13px; max-width: 250px; }
#tip b { color: #ffe08a; display: block; font-size: 14px; } #tip .st { color: #9fe07a; } #tip .act { color: #9fd8ff; margin-top: 4px; }

/* dialogs */
#w-dialog { left: 240px; bottom: 76px; width: 800px; }
#w-dialog .body { display: flex; gap: 14px; }
#w-dialog canvas { width: 130px; height: 150px; background: linear-gradient(#bfe6ff, #f6ecd2); border: 2px solid #3a2a22; border-radius: 10px; flex: none; }
#w-dialog .txt { flex: 1; } #w-dialog .txt p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
#w-dialog .choices { display: flex; flex-wrap: wrap; gap: 7px; }
#w-shop { left: 330px; top: 60px; width: 620px; } #w-lab { left: 300px; top: 60px; width: 680px; }
.list { max-height: 400px; overflow-y: auto; } .list .it { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed #c9b88a; }
.list .it .ico { font-size: 26px; width: 36px; text-align: center; } .list .it .ico img { width: 36px; height: 36px; object-fit: contain; display: block; } .list .it .nm { flex: 1; } .list .it .nm small { display: block; color: #6a5a46; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; } .tabs button { flex: 1; }
.tabs .on { background: #4a5470; color: #fff; }
.need { color: #b0352a; font-weight: bold; } .have { color: #2f7a3a; font-weight: bold; }

#w-question { left: 290px; top: 110px; width: 700px; z-index: 30; }
#w-question .q { font-size: 19px; font-weight: bold; white-space: pre-line; margin: 4px 0 14px; line-height: 1.4; }
#w-question .timer { height: 14px; background: #1c2030; border-radius: 7px; overflow: hidden; border: 2px solid #3a2a22; margin-bottom: 14px; }
#w-question .timer div { height: 100%; background: linear-gradient(90deg, #ff5a3a, #ffd84a, #6ad86a); width: 100%; }
#w-question .ch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#w-question .ch button { background: #fff; border: 3px solid #3a2a22; border-radius: 10px; padding: 12px; font-size: 17px; font-weight: bold; box-shadow: 0 3px 0 #3a2a22; }
#w-question .ch button:hover:not(:disabled) { background: #fff3c2; }
#w-question .ch button.right { background: #b8f0a0; } #w-question .ch button.wrong { background: #ffb0a0; }
#w-question .res { margin-top: 14px; font-size: 15px; line-height: 1.45; } #w-question .res b.ok { color: #2f7a3a; } #w-question .res b.no { color: #b0352a; }
#w-dead { left: 440px; top: 240px; width: 400px; z-index: 30; text-align: center; } #w-dead .body { padding: 18px; font-size: 16px; }

/* menu, settings, bestiary */
#w-menu { left: 490px; top: 200px; width: 300px; z-index: 25; } #w-menu .body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.btn.big { font-size: 17px; padding: 10px; } .btn.on { background: #4a5470; color: #fff; }
#w-settings { left: 420px; top: 190px; width: 440px; z-index: 25; }
.setrow { display: flex; align-items: center; gap: 12px; margin: 10px 2px; } .setrow label { width: 140px; font-weight: bold; } .setrow input[type=range] { flex: 1; }
.langs { display: flex; gap: 6px; }
#w-dex { left: 190px; top: 40px; width: 900px; }
.dexcols { display: flex; gap: 14px; } .dexlist { display: grid; grid-template-columns: repeat(3, 100px); gap: 8px; }
.dextile { background: #e6d8b4; border: 2px solid #b9a67a; border-radius: 10px; text-align: center; cursor: pointer; padding: 3px 2px 5px; }
.dextile canvas { width: 66px; height: 55px; display: block; margin: 0 auto; } .dextile span { font-size: 11px; font-weight: bold; display: block; line-height: 1.1; min-height: 24px; }
.dextile.on { border-color: #ff7a2e; background: #fff3d2; } .dextile.unk span { color: #8a7a66; }
.dexdetail { flex: 1; min-height: 430px; } .dexdetail canvas { float: right; width: 150px; height: 115px; background: linear-gradient(#cfe9ff, #f6ecd2); border: 2px solid #3a2a22; border-radius: 10px; margin: 0 0 8px 12px; }
.dexdetail h4 { margin: 2px 0 0; font-size: 21px; } .dexdetail h4 small { font-size: 13px; color: #8a5a22; } .dexdetail .sci { margin: 0 0 8px; font-style: italic; color: #6a5a46; }
.dexdetail p { margin: 6px 0; } .dexdetail .info { background: #fff8e2; border-left: 4px solid #ffb02e; padding: 7px 10px; border-radius: 6px; line-height: 1.4; }
.dexstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 6px 0; } .dexstats span { background: #e6d8b4; border-radius: 7px; padding: 4px 8px; } .dexstats b { display: block; font-size: 11px; color: #8a5a22; }
.dexdrops { display: flex; flex-wrap: wrap; gap: 5px; } .dexdrops img { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; } .dexdrops span { background: #fff; border: 1px solid #b9a67a; border-radius: 7px; padding: 2px 7px; font-size: 13px; } .dexdrops i { color: #8a5a22; font-style: normal; font-weight: bold; }
.clangs { margin-left: auto; display: flex; gap: 5px; } .clangs button { background: #fff; border: 2px solid #3a2a22; border-radius: 7px; padding: 3px 8px; font-size: 12px; font-weight: bold; } .clangs button.on { background: #4a5470; color: #fff; }
#btns kbd { font-size: 10px; }
#btns i { display: none; font-style: normal; }

/* history cinematics (public/js/cine.js) */
#cine { position: absolute; inset: 0; z-index: 60; background: #0b0a09; opacity: 0; transition: opacity .5s; cursor: pointer; overflow: hidden; }
#cine.on { opacity: 1; } #cine.off { opacity: 0; pointer-events: none; }
#cine .shot { position: absolute; inset: 64px 0; background: radial-gradient(ellipse at 50% 40%, #4a3a2a, #120e0b 75%); overflow: hidden; }
#cine video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1); transition: opacity .6s, transform 14s linear; }
#cine video.on { opacity: 1; transform: scale(1.07); }
#cine .card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f3e6c8; transition: opacity .8s; text-shadow: 0 3px 12px #000; }
#cine .card b { font: bold 108px Georgia, "Times New Roman", serif; letter-spacing: 6px; animation: cineIn 1.4s ease-out; }
#cine .card span { font: italic 30px Georgia, "Times New Roman", serif; margin-top: 4px; opacity: .9; animation: cineIn 1.8s ease-out; }
#cine.go .card { opacity: 0; }
#cine .sub { position: absolute; left: 90px; right: 90px; bottom: 76px; text-align: center; opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
#cine .sub.on { opacity: 1; transform: none; }
#cine .sub span { display: inline-block; background: rgba(10,8,6,.62); color: #fff; font-size: 25px; line-height: 1.35; padding: 6px 16px; border-radius: 8px; text-shadow: 0 2px 3px #000; }
#cine .hint { position: absolute; left: 24px; bottom: 22px; color: #8d8270; font-size: 14px; }
#cine .skip { position: absolute; right: 22px; bottom: 16px; background: rgba(255,255,255,.1); color: #e8dcc4; border: 1.5px solid #8d8270; border-radius: 8px; padding: 5px 14px; font: bold 14px "Trebuchet MS", sans-serif; cursor: pointer; }
#cine .skip:hover { background: rgba(255,255,255,.22); }
@keyframes cineIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.btn.film { padding: 0 7px; font-size: 11px; margin-left: 4px; box-shadow: 0 1px 0 #3a2a22; }


/* window parts: section labels, progress bars, pills, tags, tiles */
.sec { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; font-size: 11.5px; font-weight: bold; letter-spacing: .08em; text-transform: uppercase; color: #8a5a22; }
.sec::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, #dcc89a, transparent); order: 1; }
.sec .pill { order: 2; }
.win .body > .sec:first-child { margin-top: 2px; }
.pill { background: #e6d8b4; border: 1.5px solid #b9a67a; border-radius: 99px; padding: 0 9px; font-size: 12px; letter-spacing: 0; color: #3a2a22; }
.pill.hot { background: #ffb02e; border-color: #3a2a22; animation: hot 1.2s ease-in-out infinite; }
@keyframes hot { 50% { box-shadow: 0 0 0 4px rgba(255,176,46,.35); } }
.pb { height: 8px; background: #d9c9a0; border: 1.5px solid #3a2a22; border-radius: 99px; overflow: hidden; }
.pb i { display: block; height: 100%; background: linear-gradient(#ffe86a, #e0a820); border-radius: 99px; transition: width .3s; }
.pb.thin { height: 6px; border-width: 1px; }
.tag { display: inline-block; background: #4a5470; color: #fff; border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: bold; }
.tag.lv { background: #ffb02e; color: #3a2a22; border: 1.5px solid #3a2a22; padding: 0 7px; }
.lead { margin: 0 0 8px; line-height: 1.4; }

/* character */
.hero { display: flex; gap: 12px; align-items: center; }
.hero canvas { width: 96px; height: 100px; flex: none; border: 2px solid #3a2a22; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #fff6d6, #bfe3ff 70%); }
.hinfo { flex: 1; min-width: 0; }
.hname { display: block; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; gap: 5px; margin: 3px 0 7px; flex-wrap: wrap; }
.meter { position: relative; margin-top: 4px; }
.meter .pb { height: 15px; background: #2a2f40; }
.meter span { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 15px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px #000; }
.meter.hp i { background: linear-gradient(#ff8a7a, #d9352a); } .meter.mp i { background: linear-gradient(#7ac4ff, #2a6fd9); }
.srow { display: grid; grid-template-columns: 38px 1fr auto 26px; align-items: center; gap: 8px; padding: 5px 8px; background: rgba(255,255,255,.6); border: 1.5px solid #e6d6ac; border-radius: 9px; margin-bottom: 4px; }
.srow b { color: #8a5a22; } .srow span { font-size: 11.5px; color: #8a7a66; line-height: 1.2; } .srow em { font-style: normal; font-weight: bold; font-size: 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile { background: #fffaf0; border: 1.5px solid #e6d6ac; border-radius: 9px; padding: 4px 8px; }
.tile small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #8a7a66; font-weight: bold; } .tile b { font-size: 15px; }

/* items */
.slot.big { width: 54px; height: 54px; } .slot.big img { width: 44px; height: 44px; }
.slot.empty { cursor: default; } .slot.empty:hover { border-color: #b9a67a; background: linear-gradient(#efe3c2, #e2d1a6); }
.equip .slot.empty:hover { border-color: #8aa0b8; background: linear-gradient(#e2ecf6, #c9d8ea); }
.ghost { opacity: .3; filter: grayscale(1); }
.foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.foot .muted { font-size: 11.5px; line-height: 1.25; }
.coin { background: #3a2a22; color: #ffe08a; border-radius: 99px; padding: 3px 12px; font-weight: bold; white-space: nowrap; } .coin small { color: #d9c08a; font-weight: normal; }

/* skills */
.cards { display: grid; gap: 7px; }
.card { background: #fffaf0; border: 1.5px solid #e6d6ac; border-left: 7px solid var(--c); border-radius: 10px; padding: 7px 10px; }
.card > b { font-size: 15px; } .card > small { margin-left: 6px; color: #8a7a66; }
.card p { margin: 4px 0 0; display: flex; gap: 6px; font-size: 13px; line-height: 1.35; } .card p i { font-style: normal; }
.school { background: linear-gradient(90deg, #fffaf0, #fff3d2); border: 1.5px solid #e6d6ac; border-left: 8px solid var(--c); border-radius: 10px; padding: 6px 12px; }
.school small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #8a7a66; font-weight: bold; }
.school b { font-size: 19px; } .school span { margin-left: 6px; color: #6a5a46; }
.skill { display: flex; gap: 10px; align-items: flex-start; background: #fffaf0; border: 1.5px solid #e6d6ac; border-radius: 10px; padding: 9px 10px; }
.sico { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 2px solid #3a2a22; background: radial-gradient(circle at 40% 35%, #fff6b0, #ffb02e 60%, #c96a1a); display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 2px 0 #3a2a22; }
.sinfo { flex: 1; } .sinfo p { margin: 4px 0 2px; font-size: 13px; line-height: 1.35; } .sinfo small { color: #8a5a22; font-weight: bold; font-size: 12px; }
.pips { display: flex; gap: 2px; margin-top: 7px; } .pips i { flex: 1; height: 8px; border-radius: 3px; background: #e6d6ac; border: 1px solid #c9b88a; }
.pips i.on { background: linear-gradient(#ffd84a, #ffa821); border-color: #3a2a22; }

/* quests */
.qcols { display: flex; gap: 12px; align-items: stretch; }
.qside { width: 236px; flex: none; display: flex; flex-direction: column; }
.qtabs { display: flex; gap: 3px; background: #e2d2a8; border-radius: 11px; padding: 3px; border: 1.5px solid #c9b88a; }
.qtabs button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 5px 2px; font-size: 12.5px; font-weight: bold; color: #6a5a46; white-space: nowrap; }
.qtabs button b { margin-left: 4px; background: rgba(58,42,34,.14); border-radius: 99px; padding: 0 6px; font-size: 11px; }
.qtabs button.on { background: #4a5470; color: #fff; box-shadow: 0 2px 0 #2c3348; } .qtabs button.on b { background: rgba(255,255,255,.22); }
.qlist { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 452px; overflow-y: auto; padding-right: 2px; }
.qi { position: relative; padding: 7px 28px 8px 10px; background: rgba(255,255,255,.6); border: 2px solid #e6d6ac; border-radius: 10px; cursor: pointer; }
.qi:hover { background: #fffaf0; } .qi.on { border-color: #ff7a2e; background: #fff3d2; box-shadow: 0 2px 0 rgba(255,122,46,.35); }
.qi b { font-size: 13.5px; } .qi small { display: block; font-size: 11.5px; color: #6a5a46; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi .pb { margin-top: 5px; } .qi.done { opacity: .82; }
.qi > em { position: absolute; right: 7px; top: 6px; font-style: normal; font-size: 13px; } .qi > em.ok { color: #2f7a3a; font-weight: bold; } .qi > em.go { color: #e08a00; }
.yr { margin-left: 5px; font: bold 10.5px Georgia, serif; background: #3a2a22; color: #ffe08a; border-radius: 5px; padding: 0 5px; vertical-align: 1px; }
.qdetail { flex: 1; min-width: 0; background: #fffaf0; border: 2px solid #e6d6ac; border-radius: 12px; padding: 12px 14px; min-height: 400px; max-height: 500px; overflow-y: auto; }
.qhead { display: flex; gap: 10px; align-items: center; }
.qhead .year { font: bold 21px Georgia, "Times New Roman", serif; background: #3a2a22; color: #ffe08a; border-radius: 9px; padding: 5px 10px; box-shadow: 0 2px 0 #c9603f; }
.qhead h4 { margin: 0; font-size: 20px; line-height: 1.15; } .qhead small { color: #8a7a66; }
.story { margin: 10px 0; line-height: 1.45; } .story.done { font-style: italic; color: #2f5a3a; }
.next { background: linear-gradient(#fff6d0, #ffe9a0); border: 2px solid #e0a820; border-radius: 10px; padding: 6px 10px; }
.next small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #8a5a22; font-weight: bold; } .next b { font-size: 14px; }
.next.ready { background: linear-gradient(#e8f8dc, #c8eeb0); border-color: #5aa040; }
.obj { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 2px 6px; padding: 5px 0; border-bottom: 1px dashed #e6d6ac; }
.obj i { font-style: normal; text-align: center; } .obj em { font-style: normal; font-weight: bold; } .obj .pb { grid-column: 2 / 4; }
.obj.done span { color: #8a7a66; text-decoration: line-through; } .obj.done i { color: #2f7a3a; font-weight: bold; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1.5px solid #e0cfa4; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: bold; } .chip img { width: 20px; height: 20px; object-fit: contain; }
.qctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 2px solid #efe3c4; }
.switch { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 0; font-size: 13px; font-weight: bold; color: #3a2a22; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #c9b88a; border: 2px solid #3a2a22; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 1.5px solid #3a2a22; transition: left .15s; }
.switch.on i { background: #6ad86a; } .switch.on i::after { left: 17px; }
.guiding { font-size: 12.5px; font-weight: bold; color: #2f7a3a; background: #e2f6d6; border: 1.5px solid #9fd88a; border-radius: 99px; padding: 3px 10px; }
.empty { padding: 18px 8px; text-align: center; line-height: 1.4; }

/* mission tracker under the minimap */
#qtrack { position: absolute; right: 12px; top: calc(var(--mmh, 120px) + 32px); width: 252px; background: rgba(24,28,42,.8); border: 2px solid rgba(255,255,255,.85); border-radius: 12px; color: #fff; font-size: 12.5px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.qth { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,.04)); cursor: pointer; }
.qth b { flex: 1; color: #ffe08a; font-size: 13px; } .qth small { color: #c8d0e4; }
.qth button { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 6px; width: 24px; height: 20px; padding: 0; font-size: 12px; }
.qtq { padding: 6px 10px 7px; border-top: 1px solid rgba(255,255,255,.12); cursor: pointer; }
.qtq:hover { background: rgba(255,255,255,.07); }
.qtn { font-weight: bold; font-size: 13px; text-shadow: 0 1px 2px #000; } .qtn i { font-style: normal; color: #ffd84a; margin-right: 4px; }
.qtq.on .qtn { color: #ffd84a; } .qtn em { font-style: normal; color: #7dff6a; }
.qto { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; color: #dfe6f5; } .qto em { font-style: normal; font-weight: bold; color: #fff; }
.qto.done { color: #9fe07a; } .qto.done span { text-decoration: line-through; }
#qtrack .pb { background: rgba(255,255,255,.16); border: 0; height: 4px; margin-top: 2px; }
.qtx { margin-top: 4px; font-size: 11.5px; color: #9fd8ff; } .qtx::before { content: '→ '; }

/* ---------------------------------------------------------------- phones and tablets (body.touch, see touch.js)
   The stage is scaled to the screen like on desktop, which is about 0.5 on a phone, and is as wide
   as the phone's shape (--sw, set in main.js fit()). The HUD, the screens and the cinematics are
   laid out in a smaller box (--sw/u × 720/u) and scaled up by --u,
   so text and buttons keep a finger-friendly size. Windows are centred and one at a time. */
body.touch { touch-action: manipulation; -webkit-touch-callout: none; overscroll-behavior: none; }
body.touch #hud, body.touch .screen, body.touch #cine { inset: auto; left: 0; top: 0; width: calc(var(--sw, 1280px) / var(--u, 1)); height: calc(720px / var(--u, 1)); transform: scale(var(--u, 1)); transform-origin: 0 0; }
body.touch #c { touch-action: none; }
#safe { position: fixed; visibility: hidden; pointer-events: none; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
body.touch .screen { justify-content: flex-start; overflow-y: auto; padding: 8px 0; }
body.touch .screen > :first-child { margin-top: auto; } body.touch .screen > :last-child { margin-bottom: auto; }
body.touch .logo .r { font-size: 84px; }
body.touch .logo.small { margin: -37px 0 -25px; }
body.touch .charsp { width: calc(100% - 16px); padding: 10px 14px; }
body.touch .cslot { min-height: 0; padding: 6px 6px 8px; }
body.touch .cslot canvas { width: 130px; height: 137px; }
body.touch .cslot input, body.touch .row input, body.touch #chatin { font-size: 16px; }   /* 16px: iOS does not zoom into the field */
body.touch .creator { width: calc(100% - 16px); padding: 10px 14px; }
body.touch .creator h2 { font-size: 20px; margin-bottom: 6px; }
body.touch .preview { width: 190px; height: 222px; flex: none; } body.touch #pv { width: 190px; height: 222px; }
body.touch .opts { gap: 5px 8px; grid-template-columns: 80px 1fr; }
body.touch .sw button { width: 30px; height: 30px; } body.touch .sw button.txt { width: auto; }
body.touch .row { flex-wrap: wrap; margin-top: 8px; }

/* hud */
body.touch #bar { height: 40px; gap: 8px; padding: 0 10px; border-top-width: 2px; }
body.touch #lvl { font-size: 10px; padding: 1px 7px; } body.touch #lvl b { font-size: 16px; }
body.touch #who { min-width: 0; max-width: 150px; overflow: hidden; white-space: nowrap; } body.touch #who b { font-size: 13px; } body.touch #who i { font-size: 10px; }
body.touch .gauge { height: 18px; max-width: none; } body.touch .gauge span { font-size: 9px; line-height: 14px; }
body.touch .gauge.exp { max-width: none; flex: 1.3; }
body.touch #mapname { left: 8px; top: 6px; font-size: 13px; padding: 3px 10px; }
body.touch #mapname small { font-size: 10.5px; }
body.touch #mm { right: 6px; top: 6px; transform: scale(.7); transform-origin: 100% 0; }
body.touch #buffs { left: 8px; right: auto; top: 140px; flex-direction: column; align-items: flex-start; }
body.touch #btns { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); margin: 0; gap: 5px; z-index: 2; }
body.touch #btns button { width: 38px; height: 38px; padding: 0; font-size: 19px; line-height: 1; border-radius: 10px; background: rgba(246,236,210,.92); }
body.touch #btns i { display: inline; } body.touch #btns span, body.touch #btns kbd { display: none; }
body.touch #chatlog { left: 8px; top: 58px; bottom: auto; width: 290px; max-height: 76px; font-size: 11.5px; justify-content: flex-start; }
body.touch #hud.typing #chatlog { bottom: auto; }
body.touch #chatin { left: 50%; top: 52px; bottom: auto; transform: translateX(-50%); width: 70%; z-index: 30; }
body.touch #toast { top: 54px; }

/* controls */
#tc { position: absolute; inset: 0; pointer-events: none; }
#tc > * { pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
#tc-zone { position: absolute; left: 0; bottom: 40px; width: 42%; height: 62%; }
#tc-base { position: absolute; left: 92px; top: calc(100% - 88px); width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; background: rgba(255,255,255,.14); border: 3px solid rgba(255,255,255,.4); opacity: .55; transition: opacity .15s; }
#tc-base.on { opacity: 1; }
#tc-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,.75); border: 3px solid #3a2a22; }
#tc button { position: absolute; border-radius: 50%; border: 3px solid #3a2a22; background: rgba(246,236,210,.86); color: #3a2a22; font-size: 26px; line-height: 1; padding: 0; box-shadow: 0 3px 0 rgba(28,32,48,.7); }
#tc button.down { transform: translateY(2px) scale(.94); box-shadow: 0 1px 0 rgba(28,32,48,.7); background: #ffe7a6; }
#tc button.off { display: none; }
#tc-atk { right: 22px; bottom: 54px; width: 80px; height: 80px; background: rgba(255,176,46,.92) !important; font-size: 34px !important; }
#tc-jump { right: 116px; bottom: 48px; width: 64px; height: 64px; font-size: 24px !important; }
#tc-skill { right: 28px; bottom: 148px; width: 56px; height: 56px; }
#tc-skill2 { right: 40px; bottom: 214px; width: 52px; height: 52px; }
#tc-skill, #tc-skill2 { font-size: 24px !important; }
#tc-ctx { right: 106px; bottom: 124px; width: 58px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,.95) !important; }
#tc-ctx small { font-size: 9.5px; font-weight: bold; margin-top: 1px; }
#tc-hp, #tc-mp { width: 40px; height: 40px; font-size: 18px !important; bottom: 50px; }
#tc-hp { right: 192px; } #tc-mp { right: 238px; }

/* windows: centred, at most the screen, one at a time */
body.touch .win { left: 50% !important; top: calc(50% + 24px) !important; right: auto !important; bottom: auto !important; transform: translate(-50%, -50%); max-width: calc(100% - 12px); max-height: calc(100% - 58px); overflow: auto; z-index: 3; }
body.touch .win h3 { position: sticky; top: 0; z-index: 1; padding: 7px 10px; }
body.touch .win h3 button { width: 34px; height: 30px; font-size: 18px; }
body.touch .win .plus { width: 34px; height: 30px; }
body.touch .btn { padding: 7px 14px; font-size: 14px; }
body.touch #w-dialog { top: auto !important; bottom: 6px !important; transform: translateX(-50%); width: calc(100% - 12px); max-height: 72%; }
body.touch #w-dialog canvas { width: 78px; height: 90px; }
body.touch #w-dialog .txt p { font-size: 14px; }
body.touch #w-wmap { width: max-content; }
body.touch #w-wmap canvas { width: auto; height: calc(720px / var(--u, 1) - 172px); max-width: 100%; }
body.touch #w-wmap .wmbar { flex-wrap: wrap; } body.touch #w-wmap .wmbar em { display: none; }
body.touch #w-wmap .wmbar button { padding: 6px 10px; }
body.touch #w-dex { width: calc(100% - 12px); }
body.touch .dexlist { grid-template-columns: repeat(3, 78px); gap: 6px; }
body.touch .dextile canvas { width: 56px; height: 47px; }
body.touch .dexdetail { min-height: 0; } body.touch .dexdetail canvas { width: 120px; height: 92px; }
body.touch #w-shop, body.touch #w-lab, body.touch #w-question, body.touch #w-help { width: calc(100% - 12px); }
body.touch .list { max-height: none; }
body.touch #w-question .q { font-size: 16px; margin-bottom: 10px; }
body.touch #w-question .ch button { padding: 10px; font-size: 15px; }
body.touch .grid { grid-template-columns: repeat(6, 46px); }
body.touch .slot { width: 46px; height: 46px; }
body.touch #tip { display: none; }
body.touch #cine .sub { left: 24px; right: 24px; bottom: 60px; } body.touch #cine .sub span { font-size: 18px; }
body.touch #cine .card b { font-size: 72px; } body.touch #cine .card span { font-size: 22px; }
body.touch #cine .shot { inset: 34px 0; }
body.touch #cine .skip { padding: 8px 16px; font-size: 15px; }

/* phone: windows and the tracker */
body.touch #w-quests, body.touch #w-skills { width: calc(100% - 12px); }
body.touch #w-stats, body.touch #w-items { width: 360px; }
body.touch .qside { width: 200px; } body.touch .qlist { max-height: none; } body.touch .qdetail { min-height: 0; max-height: none; }
body.touch .qtabs button { padding: 7px 2px; font-size: 11.5px; }
body.touch .switch i { width: 44px; height: 26px; } body.touch .switch i::after { width: 18px; height: 18px; } body.touch .switch.on i::after { left: 20px; }
body.touch #qtrack { right: 6px; top: calc(var(--mmh, 120px) * .7 + 22px); width: 204px; font-size: 11.5px; border-radius: 10px; }
body.touch .qth { padding: 3px 5px 3px 8px; } body.touch .qth button { width: 30px; height: 24px; }
body.touch .qtq { padding: 4px 8px 6px; } body.touch .qtn { font-size: 12px; }

/* portrait phone: ask to turn it */
#rotate { display: none; }
@media (orientation: portrait) {
  body.touch #rotate { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; background: linear-gradient(#3d9cf0, #c8ecff 70%, #f6e7b4); color: #24405c; }
  body.touch #rotate .ph { font-size: 64px; animation: turn 2.4s ease-in-out infinite; }
  body.touch #rotate b { font-size: 24px; color: #3a2a22; } body.touch #rotate p { margin: 0; font-size: 16px; } body.touch #rotate .home { margin-top: 18px; font-size: 14px; max-width: 320px; }
}
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------- first-play tutorial banner (tutorial.js) */
#tut { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 600px; max-width: calc(100% - 520px); min-width: 380px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(246,236,210,.97); color: #3a2a22; border: 3px solid #3a2a22; border-radius: 14px; box-shadow: 0 4px 0 rgba(28,32,48,.55), 0 8px 22px rgba(0,0,0,.3); z-index: 5; animation: tutin .35s ease-out; }
#tut.hidden { display: none; }
#tut > i { flex: none; font-style: normal; font-weight: bold; font-size: 13px; background: #ffb02e; border: 2px solid #3a2a22; border-radius: 999px; padding: 3px 9px; }
#tut > div { flex: 1; min-width: 0; }
#tut b { display: block; font-size: 16px; }
#tut p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
#tut kbd { display: inline-block; font: bold 13px "Trebuchet MS", sans-serif; min-width: 22px; text-align: center; margin: 0 2px; padding: 1px 6px; color: #3a2a22; background: #fff; border: 2px solid #3a2a22; border-bottom-width: 4px; border-radius: 6px; }
#tut button { flex: none; font: bold 13px "Trebuchet MS", sans-serif; padding: 6px 12px; border-radius: 9px; border: 2px solid #3a2a22; background: #ffb02e; color: #3a2a22; cursor: pointer; }
#tut button.alt { background: transparent; border-color: rgba(58,42,34,.35); font-weight: normal; font-size: 12px; padding: 4px 8px; }
#tut .tick { display: none; flex: none; font-size: 26px; color: #2f9a3a; font-weight: bold; }
#tut.ok { background: #e2f8cf; } #tut.ok .tick { display: block; }
body.tut-on #toast { top: 112px; }
@keyframes tutin { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tutagain { margin-top: 12px; text-align: center; }
body.touch #tut { top: 52px; width: 520px; max-width: calc(100% - 600px); min-width: 300px; padding: 6px 10px; gap: 8px; border-width: 2px; border-radius: 11px; }
body.touch #tut b { font-size: 13px; } body.touch #tut p { font-size: 11.5px; line-height: 1.35; } body.touch #tut > i { font-size: 11px; padding: 2px 7px; }
body.touch #tut button { font-size: 11.5px; padding: 5px 9px; } body.touch.tut-on #toast { top: 150px; }

/* ---------- EXP gains above the EXP gauge */
#expfeed { position: absolute; right: 14px; bottom: 66px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; }
#expfeed div { background: rgba(20,24,36,.7); color: #b8ff6a; padding: 2px 10px; border-radius: 8px; font-size: 13.5px; text-shadow: 0 1px 2px #000; animation: fade 3.2s forwards; }
#expfeed small { color: #ffe08a; font-size: 12px; }
body.touch #expfeed { right: auto; left: 8px; bottom: auto; top: 140px; align-items: flex-start; }
body.touch #expfeed div { font-size: 11.5px; padding: 1px 8px; }

/* ---------- lab: chemistry fact after a brew (optional reading) */
.labfact { background: #fff8e2; border: 2px solid #e0cfa4; border-left: 5px solid #ffb02e; border-radius: 10px; padding: 7px 10px; margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.labfact small { display: block; color: #6a5a46; margin-top: 2px; }

/* the crossing on the ship (ui.js startVoyage) */
#voyage { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: rgba(30,36,52,.86); color: #fff; border: 2px solid #fff; border-radius: 12px; padding: 6px 16px 8px; font-weight: bold; font-size: 15px; pointer-events: none; text-align: center; min-width: 280px; }
#voyage div { margin-top: 5px; height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
#voyage i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ad0ff, #ffe08a); border-radius: 4px; transition: width .25s linear; }
body.touch #voyage { bottom: 150px; font-size: 12.5px; min-width: 220px; padding: 4px 12px 6px; }
