/* --ui: interface scale from settings */
:root {
  --ui: 1;
  --stone: #3b3226; --stone2: #2e271d; --edge: #120e09; --hi: #6b5a3c; --yl: #ffe14a; --or: #ff981f; --tx: #f1e6c8; --dim: #b9a97f;
  --red: #c0241a; --grn: #2aa82a; --blu: #2a63b5; --pray: #49b8d8; --run: #e0c040;
  --panelW: 228px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #0b0906; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none;
  font: 13px/1.3 "Trebuchet MS", Verdana, sans-serif; color: var(--tx); }
body { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; font-weight: bold; color: var(--yl); background: #4a3e2c; border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--hi); cursor: pointer; padding: 5px 10px; text-shadow: 1px 1px #000; }
button:hover { background: #5a4b34; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, .slot:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }
.panel { background: var(--stone); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px var(--hi), 0 4px 18px #0008; }
.ts { text-shadow: 1px 1px 0 #000; }
.y { color: var(--yl); } .o { color: var(--or); } .g { color: #6f6; } .r { color: #f66; } .c { color: #6ff; } .v { color: #c8a0ff; } .d { color: var(--dim); }

/* Hover text, target, banners */
#hover { position: absolute; left: 8px; top: calc(env(safe-area-inset-top, 0px) + 6px); font-weight: bold; font-size: 14px; pointer-events: none; text-shadow: 1px 1px 0 #000; max-width: 55vw; z-index: 4; }
#hover .opt { color: #fff; } #hover .tgt { color: #ff0; } #hover .more { color: #fff; font-weight: normal; font-size: 12px; }
#target { position: absolute; left: 8px; top: calc(env(safe-area-inset-top, 0px) + 30px); width: 170px; padding: 5px 7px; display: none; z-index: 3; }
#target .bar, #boss .bar { height: 12px; background: var(--red); border: 1px solid #000; margin-top: 3px; position: relative; }
#target .bar i, #boss .bar i { display: block; height: 100%; background: var(--grn); transition: width .15s; }
#boss { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 8px); transform: translateX(-50%); width: min(360px, 60vw); padding: 6px 10px; text-align: center; display: none; z-index: 3; }
#boss .bar { height: 16px; } #boss .bar i { background: #7a2fb0; }
#banner { position: absolute; left: 0; right: 0; top: 22%; text-align: center; pointer-events: none; opacity: 0; transition: opacity .8s; z-index: 3; }
#banner b { display: block; font-size: 30px; color: var(--yl); text-shadow: 2px 2px 0 #000, 0 0 12px #000; letter-spacing: 1px; }
#banner span { font-size: 13px; color: var(--tx); text-shadow: 1px 1px 0 #000; }

/* Minimap and orbs */
#mapwrap { position: absolute; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 8px); width: 196px; height: 150px; z-index: 3; }
#minimap { position: absolute; right: 0; top: 0; width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--edge); box-shadow: 0 0 0 2px var(--hi); background: #1a2414; cursor: pointer; }
#compass { position: absolute; right: 122px; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--stone); border: 2px solid var(--edge); color: #f33; font-weight: bold; display: grid; place-items: center; font-size: 13px; cursor: pointer; }
.orb { position: absolute; width: 46px; height: 30px; border-radius: 15px; background: var(--stone2); border: 2px solid var(--edge); display: flex; align-items: center; gap: 3px; padding: 0 5px 0 2px; font-weight: bold; font-size: 13px; color: #0f0; text-shadow: 1px 1px #000; cursor: pointer; }
.orb i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: #000; overflow: hidden; position: relative; }
.orb i u { position: absolute; left: 0; right: 0; bottom: 0; text-decoration: none; }
.orb i em { position: relative; font-style: normal; }
#orbHp { right: 152px; top: 32px; } #orbPr { right: 156px; top: 66px; } #orbRun { right: 150px; top: 100px; } #orbSpec { right: 158px; top: 134px; }
#orbHp u { background: var(--red); } #orbPr u { background: var(--pray); } #orbRun u { background: var(--run); } #orbSpec u { background: #46a85a; }
.orb.none { opacity: 0.55; }
.specbar { position: relative; height: 16px; margin: 4px 0 2px; background: #000; border: 1px solid var(--edge); border-radius: 3px; overflow: hidden; }
.specbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#7ad88a, #2e8a42); }
.specbar b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; color: #fff; text-shadow: 1px 1px #000; }
.specbar.short i { background: linear-gradient(#8a8a8a, #4a4a4a); }
.orb.on { box-shadow: 0 0 0 2px var(--yl); }
#status { position: absolute; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 182px); display: flex; gap: 4px; z-index: 3; flex-wrap: wrap; justify-content: flex-end; max-width: 200px; }
#status span { padding: 2px 6px; font-size: 12px; font-weight: bold; }
#xpdrops { position: absolute; right: 170px; top: calc(env(safe-area-inset-top, 0px) + 40px); width: 120px; pointer-events: none; z-index: 3; }
.xpd { position: absolute; right: 0; white-space: nowrap; font-weight: bold; color: #fff; text-shadow: 1px 1px #000; animation: xpup 1.8s linear forwards; }
@keyframes xpup { from { transform: translateY(70px); opacity: 1; } 80% { opacity: 1; } to { transform: translateY(-10px); opacity: 0; } }

/* Chat */
#chat { position: absolute; left: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); width: min(470px, calc(100vw - var(--panelW) - 26px)); height: 136px; padding: 5px 8px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; z-index: 3; font-size: 13px; }
#chat div { text-shadow: 1px 1px #000; }
#chat .ts-time { color: var(--dim); font-size: 11px; margin-right: 4px; }

/* Side panel */
#side { position: absolute; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); width: var(--panelW); z-index: 3; display: flex; flex-direction: column; }
#tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; }
#tabs button { min-width: 0; overflow: hidden; padding: 4px 0; font-size: 17px; line-height: 1; background: #3a3022; }
#tabs button.on { background: #6a3a22; box-shadow: inset 0 0 0 2px var(--or); }
#pane { height: 352px; padding: 6px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
#pane h4 { margin: 0 0 5px; color: var(--or); font-size: 14px; text-shadow: 1px 1px #000; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.slot { position: relative; height: 38px; background: #2a2318; border: 1px solid #0009; display: grid; place-items: center; font-size: 22px; cursor: pointer; touch-action: none; }
.slot em { position: absolute; left: 2px; top: 0; font-size: 10px; font-style: normal; color: var(--yl); text-shadow: 1px 1px #000; font-weight: bold; }
.slot em.k { color: #fff; } .slot em.m { color: #0f8; }
.slot.sel { box-shadow: inset 0 0 0 2px #fff; }
.slot.use { box-shadow: inset 0 0 0 2px var(--yl); }
.slot.drag { opacity: .35; }
.slot.over { box-shadow: inset 0 0 0 2px var(--or); }
.slot .lbl { font-size: 10px; color: var(--dim); }
.ghost { position: fixed; pointer-events: none; z-index: 50; font-size: 24px; opacity: .85; transform: translate(-50%, -50%); }
/* Metal tints for emoji icons */
.tb { filter: sepia(1) saturate(3) hue-rotate(-10deg); } .ti { filter: grayscale(1) brightness(1.05); } .ts2 { filter: grayscale(1) brightness(1.4) sepia(.5) hue-rotate(170deg) saturate(3); }
.th { filter: hue-rotate(220deg) saturate(1.6) brightness(.9); } .to { filter: sepia(.6) saturate(1.5); }
.td { filter: grayscale(1) brightness(.85) sepia(.6) hue-rotate(205deg) saturate(2.4); }
.tg { filter: sepia(1) saturate(4) brightness(1.15); }
.tv { filter: sepia(1) saturate(3) hue-rotate(95deg) brightness(.95); } .tf { filter: grayscale(.5) sepia(.3) hue-rotate(170deg) saturate(2) brightness(1.15); } .tk { filter: grayscale(.6) brightness(.6) sepia(.4); } .tm { filter: sepia(1) saturate(4) hue-rotate(-25deg) brightness(.85); }
.ta { filter: sepia(.3) saturate(.6) brightness(1.25); } .tx { filter: grayscale(1) brightness(1.3) sepia(.45) hue-rotate(180deg) saturate(2.4); } .te { filter: sepia(.8) saturate(3) hue-rotate(-25deg) brightness(.8); }
.rowl { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 2px; border-bottom: 1px solid #0005; }
.rowl:hover { background: #ffffff0a; }
.btnrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.btnrow button { padding: 3px 7px; font-size: 12px; }
.style { display: block; width: 100%; margin-bottom: 4px; text-align: left; }
.style.on { background: #7a3a1a; box-shadow: inset 0 0 0 2px var(--or); }
.style small { display: block; font-weight: normal; color: var(--dim); font-size: 11px; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.sk { background: #2a2318; border: 1px solid #0009; padding: 3px 5px; display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: bold; }
.sk .n { margin-left: auto; color: var(--yl); }
.sk .b { position: absolute; }
.sk:hover, .sk.sel { box-shadow: inset 0 0 0 1px var(--or); }
.xpbar { height: 4px; background: #000a; margin-top: 2px; } .xpbar i { display: block; height: 100%; background: var(--or); }
.pray { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.pray button { padding: 4px 0; font-size: 19px; position: relative; }
.prayOn { margin-top: 6px; font-size: 12px; line-height: 1.4; }
.pray button.on { background: #2a5a6a; box-shadow: inset 0 0 0 2px #9ff; }
.pray button.locked, .spells button.locked { filter: grayscale(1); opacity: .45; }
.spells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.spells button { padding: 5px 0; font-size: 22px; }
.spells button.on { background: #3a2a6a; box-shadow: inset 0 0 0 2px #c9f; }
.quest { cursor: pointer; padding: 2px 0; }
.qr { color: #f55; } .qy { color: #ff0; } .qg { color: #0f0; }

/* Windows */
.win { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 20; display: none; padding: 10px; width: min(460px, 94vw); max-height: 78vh; overflow: auto; }
.win.show { display: block; }
.win h3 { margin: 0 0 8px; color: var(--or); text-shadow: 1px 1px #000; display: flex; justify-content: space-between; align-items: center; }
.win h3 button { padding: 0 8px; font-size: 16px; }
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
.shopgrid .slot { height: 54px; font-size: 24px; }
/* Bank (version 91): tabs, search, the quantity bar, and notes */
.banktabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.banktabs button { width: 40px; height: 34px; padding: 0; font-size: 18px; position: relative; }
.banktabs button.on { background: #6a3a22; box-shadow: inset 0 0 0 2px var(--or); }
.banktabs button.drop { box-shadow: inset 0 0 0 2px #9ff; background: #2a4a5a; }
.banktabs button small { position: absolute; left: 2px; top: 0; font-size: 9px; color: var(--yl); }
.banktabs button .noteic { transform: scale(.8) rotate(-4deg); }
.banksearch { flex: 1; min-width: 90px; background: #1a150f; color: #fff; border: 1px solid #000; padding: 4px; font: inherit; }
.bankgrid { max-height: 42vh; overflow-y: auto; margin-top: 5px; align-content: start; }
.bankgrid .slot.ph > :first-child { opacity: .3; filter: grayscale(1); }
.banksep { grid-column: 1 / -1; font-size: 11px; color: var(--dim); border-bottom: 1px solid #0007; padding: 3px 0 1px; }
.bankbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 12px; }
.bankbar .bq { display: flex; align-items: center; gap: 4px; }
.bankbar button { padding: 3px 8px; font-size: 12px; }
.bankbar button.on { background: #6a3a22; box-shadow: inset 0 0 0 2px var(--or); }
.bankx { width: 52px; background: #1a150f; color: #fff; border: 1px solid #000; padding: 3px; font: inherit; font-size: 12px; }
.glyph { width: 1.3em; height: 1.3em; display: inline-block; vertical-align: -.28em; margin: -.1em -.05em; overflow: visible; }
.noteic { display: inline-grid; place-items: center; width: 1.25em; height: 1.05em; background: #e8dcb0; border: 1px solid #8a7a50; border-radius: 2px; box-shadow: 1px 1px 0 #0007; transform: rotate(-4deg); line-height: 1; }
.noteic > span { font-size: .62em; }
.shopgrid .slot .p { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--yl); font-weight: bold; }
.info { min-height: 40px; margin-top: 8px; padding: 6px; background: #0003; font-size: 12px; }
#dialog { left: 50%; top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); transform: translateX(-50%); width: min(520px, 96vw); }
#dialog .who { color: var(--or); font-weight: bold; font-size: 15px; }
#dialog .say { margin: 6px 0 10px; line-height: 1.5; font-size: 14px; }
#dialog .opts button { display: block; width: 100%; margin-bottom: 4px; text-align: left; color: #fff; }
#equipWin .eqlay { display: grid; grid-template-columns: 154px 1fr; gap: 10px; }
#eqPrev { width: 154px; height: 210px; background: radial-gradient(#6b5a3c, #241d14); border: 2px solid var(--edge); display: block; cursor: grab; }
.paper { display: grid; grid-template-columns: repeat(3, 46px); gap: 4px; justify-content: center; margin-top: 6px; }
.paper .slot { height: 44px; font-size: 22px; }
.stats { font-size: 12px; columns: 2; column-gap: 10px; }
.stats b { display: block; color: var(--or); margin-top: 4px; break-after: avoid; }
.stats div { display: flex; justify-content: space-between; }
.recipes .rowl { cursor: pointer; }
/* Skill guide (version 94) */
.gbar { height: 7px; margin: 4px 0 5px; background: #1a150f; border: 1px solid #000; border-radius: 3px; overflow: hidden; }
.gbar i { display: block; height: 100%; background: linear-gradient(#5fd35f, #2e8a2e); }
.gtabs { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0 4px; }
.gtabs button { padding: 3px 8px; font-size: 12px; }
.gtabs button.on { background: #6a3a22; box-shadow: inset 0 0 0 2px var(--or); }
.glist { max-height: 46vh; overflow-y: auto; }
.grow { justify-content: flex-start; font-size: 13px; }
.grow .gic { width: 26px; text-align: center; font-size: 18px; flex: none; }
.grow .gtx { flex: 1; }
.grow > b { flex: none; min-width: 22px; text-align: right; }
.grow.locked .gic, .grow.locked .gtx { opacity: .55; }
.grow.next { background: #3a2f1c; box-shadow: inset 2px 0 0 var(--yl); }
.grow.next .gic, .grow.next .gtx { opacity: 1; }
.recipes .rowl.no { opacity: .5; }

/* Context menu */
#menu { position: fixed; z-index: 60; background: #5d5447; border: 2px solid #000; min-width: 160px; display: none; box-shadow: 0 4px 12px #000a; }
#menu .t { background: #000; color: #5d5447; padding: 2px 6px; font-weight: bold; color: #c8b896; }
#menu div.o { padding: 4px 8px; cursor: pointer; color: #fff; font-weight: bold; white-space: nowrap; }
#menu div.o:hover, #menu div.o.f { background: #6f6556; color: #ff0; }
#menu .o span { color: #ff0; } #menu .o span.npc { color: #ff0; } #menu .o span.lv { color: #0f0; }

/* Splats */
#fxl { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.splat { position: absolute; left: 0; top: 0; min-width: 24px; height: 24px; margin: -12px; padding: 0 5px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: bold; font-size: 14px; text-shadow: 1px 1px #000; border: 2px solid #fff6; }
.splat.hit { background: #b81c14; } .splat.miss { background: #2a63b5; } .splat.heal { background: #1e8a2a; } .splat.poison { background: #3a7a1a; border-color: #9f6; } .splat.burn { background: #c4600a; border-color: #ffb060; } .splat.bleed { background: #7a0a14; border-color: #ff6070; } #status .trackchip { flex-basis: 100%; text-align: right; cursor: pointer; font-size: 12px; line-height: 1.3; }
.trackbtn { margin-top: 8px; width: 100%; } .trackbtn.on { background: #6a3a22; box-shadow: inset 0 0 0 2px var(--or); }
.splat.block { background: #5a6470; border-color: #d8e2ec; }
.splat.max { background: #4a0510; border-color: #ff3b3b; color: #ffd8d8; font-size: 18px; min-width: 30px; height: 30px; margin: -15px; border-radius: 15px; box-shadow: 0 0 12px #c0102a, inset 0 0 6px #000; }
.overhead { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); color: #ff0; font-weight: bold; text-shadow: 1px 1px #000; white-space: nowrap; font-size: 14px; }
.hpbar { position: absolute; width: 40px; height: 6px; margin-left: -20px; background: var(--red); border: 1px solid #000; }
.hpbar i { display: block; height: 100%; background: var(--grn); }

/* Title and fade */
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 40; }
#title { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center;
  background: radial-gradient(ellipse at center, #2a2216ee, #0a0804f6); }
#title h1 { margin: 0; font-size: clamp(42px, 9vw, 72px); color: var(--or); text-shadow: 4px 4px 0 #000, 0 0 30px #a0400a; letter-spacing: 3px; }
#title p { margin: 0; max-width: 420px; line-height: 1.5; color: #e0d6b8; }
#title .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#title button { font-size: 18px; padding: 10px 26px; }
#title .note { font-size: 12px; color: var(--dim); max-width: 440px; }
#toast { position: absolute; left: 50%; top: 32%; transform: translateX(-50%); z-index: 30; pointer-events: none; text-align: center; padding: 10px 18px; display: none; }
#toast b { display: block; color: var(--yl); font-size: 18px; }
#fps { position: absolute; left: 8px; bottom: 150px; font-size: 11px; color: #8f8; z-index: 3; text-shadow: 1px 1px #000; display: none; }

/* Small screens: side panel collapses to its tab bar, chat shrinks */
@media (max-width: 760px) {
  :root { --panelW: 212px; }
  #pane { height: 300px; }
  #tabs button { font-size: 14px; padding: 4px 0; }
  #tabs { gap: 1px; padding: 2px; }
  #side.collapsed #pane { display: none; }
  #chat { height: 86px; font-size: 12px; width: calc(100vw - 16px); bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  #side { bottom: calc(env(safe-area-inset-bottom, 0px) + 102px); }
  #mapwrap { transform: scale(.8); transform-origin: top right; }
  #xpdrops { right: 150px; }
  .stats { columns: 1; }
  #equipWin .eqlay { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-height: 520px) { #pane { height: 200px; } #chat { height: 70px; } }
@media (prefers-reduced-motion: reduce) { .xpd { animation-duration: .01s; } #banner, #fade { transition: none; } }

/* Interface scale and colour-blind-safe hitsplats */
#side, #chat, #mapwrap, .win, #target, #boss, #status, #xpdrops { zoom: var(--ui); }
.cb .splat.hit { background: #c45a00; } .cb .splat.max { background: #3a1070; border-color: #c9a0ff; box-shadow: 0 0 12px #7a3ac0; }
.cb .splat.miss { background: #2a5a9a; } .cb .splat.heal { background: #0a7a8a; } .cb .splat.poison { background: #6a6a10; } .cb .splat.burn { background: #8a3a00; } .cb .splat.bleed { background: #5a2a6a; }
/* World map */
#mapWin { width: min(640px, 96vw); }
#mapWin canvas { width: 100%; height: auto; display: block; background: #0a0806; border: 2px solid var(--edge); image-rendering: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; margin-top: 6px; }
/* Title screen slots */
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; width: min(620px, 94vw); }
.slotcard { padding: 10px; text-align: left; }
.slotcard b { color: var(--yl); font-size: 16px; display: block; }
.slotcard .d { font-size: 12px; margin: 4px 0 8px; min-height: 30px; }
.slotcard .btnrow button { font-size: 13px; padding: 5px 10px; }
#importBox { display: none; width: min(560px, 94vw); }
#importBox textarea { width: 100%; height: 90px; background: #1a150f; color: #fff; border: 1px solid #000; font: 12px monospace; }

/* Soft darkening towards the screen edges: frames the scene like the old-school HD look. */
#vignette { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 55%, rgba(10,8,4,0.38) 100%); }

/* Character creator */
#creator { display: none; gap: 14px; padding: 12px; max-width: 760px; width: calc(100% - 32px); text-align: left; }
#creator.on { display: flex; flex-wrap: wrap; justify-content: center; }
#creator .crView { flex: 1 1 300px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#crCanvas canvas { width: 100%; max-width: 340px; aspect-ratio: 34 / 44; height: auto; display: block; border: 2px solid var(--edge); background: #15130f; cursor: grab; touch-action: none; }
#creator .crForm { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; }
#creator .crRow { display: grid; grid-template-columns: 90px 34px 1fr 34px; align-items: center; gap: 6px; }
#creator .crRow button { padding: 4px 0; font-size: 16px; }
#creator .crRow .sw { height: 24px; border: 2px solid var(--edge); display: flex; align-items: center; justify-content: center; font-size: 13px; color: #e0d6b8; }
#creator input { font: inherit; padding: 5px 8px; background: #1c1912; color: #f0e6c8; border: 2px solid var(--edge); width: 100%; }
#creator .rowl { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 6px; }
#creator button.big { font-size: 18px; padding: 10px; margin-top: 4px; }

#slots button.danger { background: #7a2018; color: #ffd8c8; }

/* Playing online (version 98): the log-in card and the disconnected notice. */
.slotcard.online { min-width: 260px; display: flex; flex-direction: column; gap: 8px; }
.slotcard.online input { flex: 1; min-width: 0; }
.slotcard.online a.site { align-self: center; font-size: 13px; color: inherit; opacity: .8; }
#netDown { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 60; padding: 16px 20px; max-width: 360px; text-align: center; }
#netDown p { margin: 8px 0 12px; }
/* The world list (playing online, version 99) and the chat line. */
.worlds { display: flex; flex-wrap: wrap; gap: 6px; }
.worlds .world { display: flex; flex-direction: column; align-items: flex-start; padding: 5px 10px; min-width: 96px; }
.worlds .world b { color: inherit; font-size: 13px; display: inline; }
.worlds .world span { font-size: 11px; opacity: .8; }
.worlds .world.on { outline: 2px solid var(--yl); }
#chatIn { margin-top: 4px; width: 100%; background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 3px 6px; font: inherit; pointer-events: auto; }
#chatIn:not(:focus) { opacity: .6; }
#chatIn.pm { border-color: #b77cff; color: #e5c8ff; }
#chat .pm { cursor: pointer; pointer-events: auto; }
.friend { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.friend .fn { flex: 1; color: #ddd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend.on .fn { color: #7f7; }
.friend .fw { font-size: 11px; color: #f77; }
.friend.on .fw { color: #ffd24a; }
.friend .fb { padding: 1px 6px; font-size: 12px; line-height: 1.3; }
.friendAdd { display: flex; gap: 4px; margin: 6px 0; }
.friendAdd input { flex: 1; min-width: 0; background: rgba(0,0,0,.4); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 3px 6px; font: inherit; }
.friendAdd button { width: auto; margin: 0; padding: 3px 8px; }
/* Trading with another player (version 106) */
#tradeWin { width: min(560px, 96vw); }
.tradecols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0; }
.tradecols > div { background: rgba(0,0,0,.2); padding: 8px; border-radius: 4px; min-height: 80px; }
.tradecols ul { margin: 6px 0; padding-left: 18px; }
#tradeWin .btnrow { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
/* Reporting a player (version 109) */
#reportWin .reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 8px 0; }
#reportWin textarea { background: rgba(0,0,0,.3); color: inherit; border: 1px solid #5a4a30; }
/* The market (version 110) */
#marketWin { width: min(600px, 96vw); }
.mkgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mkslot { background: rgba(0,0,0,.25); border: 1px solid #5a4a30; border-radius: 4px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.mkitem { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mkitem .ico, .mkitem img, .mkitem svg { width: 26px; height: 26px; }
.mkbar { height: 7px; background: rgba(0,0,0,.4); border-radius: 3px; overflow: hidden; }
.mkbar i { display: block; height: 100%; }
.mkform input { width: 140px; background: rgba(0,0,0,.3); color: inherit; border: 1px solid #5a4a30; padding: 3px 5px; }
.mkform #mkItem { width: 260px; }
.mkrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
@media (max-width: 520px) { .mkgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
