/* Layout follows the original client: stats/items/spells on the left, room name + picture + log in the middle,
   mini map, people, room buttons and status on the right. Wood textures come from the game's own Tile.bmp. */
@font-face { font-family: 'Matura'; src: url('assets/fonts/Maturasc.ttf') format('truetype'); font-display: swap; }

:root {
  --ink: #fff;
  --gold: #f4d03f;
  --cyan: #7fd6ff;
  --edge: #3a0d08;
  --edge-hi: #b0643a;
  --wood-dark: rgba(70, 12, 6, .78);
  --parch: rgba(214, 160, 40, .62);
  --c1: #ff6b5c; --c2: #6a8dff; --c3: #5fe05f; --c4: #e07be0; --c5: #7fd6ff;
  --c6: #fff04a; --c7: #ffa24a; --c8: #cdd16a; --c9: #d9a0ff;
  --good: #7fe07f; --bad: #ff7a6a;
  /* The game used the bitmap font MS Sans Serif. Browsers cannot use it, so use the closest installed look. */
  --pixel: "Microsoft Sans Serif", "MS Sans Serif", Tahoma, Verdana, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #1a0a07 url('assets/ui/Tile.bmp'); background-blend-mode: multiply;
  color: var(--ink); font: 700 12px/1.35 var(--pixel); -webkit-font-smoothing: none; font-smooth: never;
  display: flex; justify-content: center; padding: 8px;
}
.app {
  display: grid; grid-template-columns: 238px minmax(360px, 1fr) 238px; gap: 6px; width: 100%; max-width: 1060px;
  min-height: calc(100vh - 16px);
  background: #c8793a url('assets/ui/Tile.bmp'); padding: 6px; border: 2px solid var(--edge); box-shadow: 0 0 0 2px var(--edge-hi) inset;
}
.col { display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }

.logo {
  font: 700 30px/1.1 'Matura', Georgia, serif; text-align: center; color: #c01810; letter-spacing: .02em;
  text-shadow: 1px 1px 0 #2a0503, -1px -1px 0 #ffb070, 0 0 6px #000; background: #12100f; border: 2px solid var(--edge);
  padding: 4px 6px;
}
.panel { border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--edge-hi) inset; padding: 6px 8px; }
.wood { background: linear-gradient(var(--wood-dark), var(--wood-dark)), url('assets/ui/Tile.bmp'); }
.parch { background: linear-gradient(var(--parch), var(--parch)), url('assets/ui/Tile.bmp'); color: #2a1604; }
.grow { flex: 1; min-height: 120px; }
.panel h2 { margin: 0 0 4px; font: 700 12px var(--pixel); color: var(--gold); }
.parch h2 { color: #fff3c0; text-shadow: 1px 1px 0 #6a3d08; }
.list { min-height: 36px; font-weight: 400; }
.list .item { display: flex; justify-content: space-between; gap: 6px; }
.list .empty { opacity: .65; }

/* item slots: 7 across; equipped = 2 rows (14), carried = 2 rows now, 4 rows later (see INVENTORY_ROWS in game.js) */
.slots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.slot {
  aspect-ratio: 1; min-width: 0; background: rgba(0,0,0,.42); border: 1px solid var(--edge-hi); display: flex; align-items: center; justify-content: center;
  font: 700 10px/1 var(--pixel); color: var(--gold); text-align: center; overflow: hidden; padding: 1px;
}
.slot.empty { opacity: .45; }
.slot.filled { background: rgba(244, 208, 63, .16); cursor: default; }

.who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.portrait { width: 34px; height: 34px; flex: none; border: 2px solid var(--edge-hi); background: radial-gradient(circle at 50% 38%, #e3b58a 0 30%, #3b2a22 31% 100%); }
.who-text { color: var(--gold); font: 700 13px/1.2 'Matura', Georgia, serif; text-align: center; flex: 1; }
.statgrid { display: grid; grid-template-columns: 88px 1fr; gap: 6px; border: 1px solid var(--edge-hi); padding: 4px; background: rgba(0,0,0,.25); }
.statgrid table { border-collapse: collapse; width: 100%; }
.statgrid td { padding: 1px 2px; }
.attrs td:first-child { color: var(--gold); }
.attrs td:last-child, .vitals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.vitals td:first-child { color: var(--gold); }

.banner {
  background: #170b06 url('assets/ui/Tile.bmp'); background-blend-mode: multiply; border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--edge-hi) inset;
  text-align: center; padding: 3px 8px; font: 700 24px/1.2 'Matura', Georgia, serif; color: var(--gold); text-shadow: 2px 2px 0 #000;
  min-height: 38px;
}
.roompic { position: relative; background: #000; border: 2px solid var(--edge); aspect-ratio: 340 / 198; overflow: hidden; }
.roompic img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
.noimg[hidden], .roompic img[hidden] { display: none; }
.noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8a7a6a; font-weight: 400; }
.log {
  flex: 1; min-height: 220px; max-height: 60vh; overflow-y: auto; background: #000; border: 2px solid var(--edge); padding: 4px 6px;
  font: 700 12px/1.3 var(--pixel);
}
.log p { margin: 0 0 3px; overflow-wrap: anywhere; }
.log .sys { color: #c9c9c9; font-weight: 400; }
.log .good { color: var(--good); }
.log .bad { color: var(--bad); }
.log .tag { color: var(--cyan); }
.c1 { color: var(--c1); } .c2 { color: var(--c2); } .c3 { color: var(--c3); } .c4 { color: var(--c4); } .c5 { color: var(--c5); }
.c6 { color: var(--c6); } .c7 { color: var(--c7); } .c8 { color: var(--c8); } .c9 { color: var(--c9); }
.cmd input { width: 100%; background: #000; color: #fff; border: 2px solid var(--edge); padding: 5px 7px; font: 700 12px var(--pixel); }
.cmd input:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }

/* right column */
.minimap { padding: 6px; text-align: center; }
#mapWrap svg { width: 100%; height: auto; display: block; }
#mapWrap .room { cursor: default; }
#mapWrap .room.go { cursor: pointer; }
#mapWrap .room.go:hover rect { stroke: #fff; stroke-width: 2.5; }
.vert { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.vert button { padding: 2px 10px; }
.area { font-weight: 400; margin-top: 2px; font-size: 11px; }
.people { display: flex; flex-direction: column; min-height: 150px; overflow-y: auto; }
.people .person { display: flex; align-items: center; gap: 8px; color: var(--gold); font: 700 14px 'Matura', Georgia, serif; padding: 2px 0; }
.others { margin-top: 4px; font-weight: 400; display: flex; flex-direction: column; gap: 3px; }
.mon { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 3px 5px; color: #ffb59a; font: 700 12px var(--pixel); }
.mon .portrait { width: 26px; height: 26px; background: radial-gradient(circle at 50% 40%, #b04a3a 0 30%, #2a0d0a 31% 100%); }
.mon .hp { display: block; height: 4px; background: #300; margin-top: 2px; }
.mon .hp i { display: block; height: 100%; background: #d23; }
.mon .nm { flex: 1; min-width: 0; }
.roombtns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; }
button {
  font: 700 12px var(--pixel); color: var(--gold); cursor: pointer; padding: 6px 4px;
  background: linear-gradient(rgba(150,70,25,.55), rgba(90,35,10,.55)), url('assets/ui/Tile.bmp'); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--edge-hi) inset;
}
button:hover { color: #fff; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
button:disabled { opacity: .4; cursor: default; }
button.primary { color: #2a1604; background: var(--gold); }
.here .list button { margin: 2px 4px 2px 0; padding: 3px 7px; }
.status { display: flex; align-items: center; gap: 8px; padding: 5px 8px; }
#statusWord { color: var(--cyan); font-size: 14px; }
#statusWord.exhaust { color: #ff9a4a; }
#statusHp { color: var(--gold); flex: 1; }
.icons { display: flex; gap: 3px; }
.icon { padding: 2px 6px; font-size: 14px; line-height: 1; }

.hidden { display: none !important; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: #2a0f0a url('assets/ui/Tile.bmp'); background-blend-mode: multiply; border: 2px solid var(--edge-hi); padding: 16px; max-width: 400px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.dialog h2 { margin: 0; color: var(--gold); font: 700 22px 'Matura', Georgia, serif; }
.dialog label { display: flex; flex-direction: column; gap: 3px; }
.dialog input, .dialog select { background: #000; color: #fff; border: 2px solid var(--edge); padding: 6px 8px; font: 700 12px var(--pixel); }
.small { font-weight: 400; font-size: 11px; }
code { background: #000; padding: 0 3px; font-weight: 400; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .middle { order: 1; } .right { order: 2; } .left { order: 3; }
  .log { max-height: 50vh; }
}

/* ---- menu screens: log in, characters, creator, account (same wood, gold and Matura as the game) ---- */
#game { width: 100%; display: flex; justify-content: center; }
.screen { width: 100%; display: flex; justify-content: center; align-items: flex-start; padding: 8px 0; }
.frame {
  width: 100%; background: #c8793a url('assets/ui/Tile.bmp'); padding: 10px; border: 2px solid var(--edge);
  box-shadow: 0 0 0 2px var(--edge-hi) inset; display: flex; flex-direction: column; gap: 8px;
}
.frame.narrow { max-width: 380px; margin-top: 8vh; }
.frame.wide { max-width: 1060px; }
.title { font: 700 30px/1.1 'Matura', Georgia, serif; color: #c01810; text-shadow: 1px 1px 0 #2a0503, -1px -1px 0 #ffb070, 0 0 6px #000;
  background: #12100f; border: 2px solid var(--edge); padding: 4px 10px; text-align: center; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.topbar .title { flex: 1; min-width: 200px; }
.bar-right { display: flex; align-items: center; gap: 6px; }
.who-acct { color: var(--gold); }
.frame label { display: flex; flex-direction: column; gap: 3px; color: var(--gold); }
.frame input[type="text"], .frame input[type="password"], .panel input[type="text"] {
  background: #000; color: #fff; border: 2px solid var(--edge); padding: 6px 8px; font: 700 12px var(--pixel); width: 100%;
}
.frame input:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; }
.tabs button[aria-selected="true"] { color: #2a1604; background: var(--gold); }
.err { color: var(--bad); min-height: 1.4em; font-weight: 700; }
.ok { color: var(--good); min-height: 1.4em; font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.hint { font-weight: 400; font-size: 11px; opacity: .9; margin: 2px 0; }
.dim { opacity: .75; font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.danger { color: var(--bad) !important; }
.dangerbtn { color: #ffd0c8; background: linear-gradient(rgba(170,30,20,.65), rgba(90,10,6,.7)), url('assets/ui/Tile.bmp'); }
.banner-msg { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); background: #300; border: 2px solid var(--edge-hi); padding: 6px 12px; z-index: 5; }

/* character select */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.card {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px; text-align: center; color: #fff; font-weight: 400;
  background: linear-gradient(var(--wood-dark), var(--wood-dark)), url('assets/ui/Tile.bmp'); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--edge-hi) inset;
}
.emblem { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font: 700 30px 'Matura', Georgia, serif; color: var(--gold);
  border: 2px solid var(--edge-hi); background: radial-gradient(circle at 50% 35%, #7a2a14 0, #2a0d08 75%); }
.cname { font: 700 20px 'Matura', Georgia, serif; color: var(--gold); }
.csub { font-size: 12px; }
.cstats { font-size: 11px; color: var(--cyan); letter-spacing: .02em; }
.card button.primary { margin-top: 6px; min-width: 110px; }
.card.add { justify-content: center; cursor: pointer; border-style: dashed; min-height: 190px; }
.card.add .plus { font: 700 40px/1 var(--pixel); color: var(--gold); }

/* creator */
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: start; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.panel h3 { margin: 8px 0 3px; font: 700 11px var(--pixel); color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; }
.panel > h2 { margin-top: 10px; }
.panel > h2:first-child { margin-top: 0; }
.seg { display: flex; gap: 4px; margin: 6px 0; }
.seg button { flex: 1; }
.seg button[aria-pressed="true"] { color: #2a1604; background: var(--gold); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.choices.one { grid-template-columns: 1fr; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 5px 6px; color: #fff; font-weight: 400; }
.choice .ct { color: var(--gold); font-weight: 700; font-size: 13px; }
.choice .cs { font-size: 11px; }
.choice.on { outline: 2px solid var(--gold); outline-offset: -2px; background: linear-gradient(rgba(244,208,63,.28), rgba(244,208,63,.12)), url('assets/ui/Tile.bmp'); }
.choice.unmet .cs:not(.dim) { color: var(--bad); }
.statrows { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.statrow { display: grid; grid-template-columns: 1fr 26px 34px 26px 52px; align-items: center; gap: 4px; }
.statrow .sname { color: var(--gold); }
.statrow .sval { text-align: center; font: 700 15px var(--pixel); }
.statrow .smax { font-size: 11px; opacity: .7; text-align: right; }
.statrow .sbtn { padding: 1px 0; font-size: 14px; }
.points { color: var(--gold); font-size: 14px; margin: 4px 0 6px; min-height: 1.2em; }
.summary { margin-top: 14px; border-top: 1px solid var(--edge-hi); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sumname { font: 700 24px 'Matura', Georgia, serif; color: var(--gold); }
#cGo { padding: 8px; font-size: 14px; }

/* account */
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 2px 0; }
.kv td:first-child { color: var(--gold); width: 45%; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px; background: rgba(0,0,0,.28); border: 1px solid var(--edge-hi); font-weight: 400; }
.rowtext { flex: 1; min-width: 160px; }
.rowtext b { color: var(--gold); font: 700 16px 'Matura', Georgia, serif; }
.confirm { display: flex; gap: 4px; width: 100%; }
.confirm input { flex: 1; }

@media (max-width: 900px) {
  .cols3, .cols2 { grid-template-columns: 1fr; }
  .frame.narrow { margin-top: 2vh; }
}

/* gods: emblem beside the name */
.godchoice { flex-direction: row !important; align-items: center !important; gap: 8px !important; }
.godchoice .ct, .godchoice .cs { display: block; }
.godimg { width: 40px; height: 40px; flex: none; border: 2px solid var(--edge-hi); border-radius: 6px; }
.godsm { width: 20px; height: 20px; vertical-align: middle; border-radius: 4px; margin-right: 5px; }
.godrow { display: flex; align-items: center; justify-content: center; }
.row .godrow { justify-content: flex-start; }
.godicon { width: 34px; height: 34px; flex: none; border: 2px solid var(--edge-hi); border-radius: 6px; }

/* the Roll button: centered and big */
#cRoll { display: block; margin: 10px auto 12px; padding: 14px 64px; font-size: 22px; font-family: 'Matura', Georgia, serif; letter-spacing: .04em; color: #2a1604; background: var(--gold); }
#cRoll:hover { color: #000; filter: brightness(1.1); }

/* items in the slots: the item's own picture */
.slot.filled { padding: 0; cursor: pointer; }
.slot.filled:hover, .slot.filled:focus-visible { outline: 2px solid var(--gold); outline-offset: -1px; }
.slotimg { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
.nopic { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--gold); font: 700 14px var(--pixel); }
.itemmenu { position: fixed; z-index: 20; min-width: 130px; display: flex; flex-direction: column; gap: 3px; padding: 5px;
  background: #2a0f0a url('assets/ui/Tile.bmp'); background-blend-mode: multiply; border: 2px solid var(--edge-hi); box-shadow: 0 4px 14px rgba(0,0,0,.6); }
.itemmenu .mtitle { color: var(--gold); font: 700 12px var(--pixel); padding: 2px 4px 4px; border-bottom: 1px solid var(--edge-hi); max-width: 200px; overflow-wrap: anywhere; }
.itemmenu button { text-align: left; padding: 5px 8px; }

/* examine: item picture on the left, description where the room picture was */
.examine { position: absolute; inset: 0; display: flex; gap: 14px; align-items: center; padding: 14px; z-index: 2;
  background: #1a0a07 url('assets/ui/Tile.bmp'); background-blend-mode: multiply; overflow: auto; }
.exbig { flex: none; width: 128px; height: 128px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); border: 2px solid var(--edge-hi); }
.exbigimg { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.exbig .nopic { font-size: 48px; }
.extext { flex: 1; min-width: 0; font-weight: 400; }
.exname { font: 700 26px 'Matura', Georgia, serif; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.extype { color: var(--cyan); font-weight: 700; }
.exstats { color: var(--gold); margin: 3px 0; font-weight: 700; }
.extext p { margin: 6px 0 10px; font-size: 13px; line-height: 1.4; }

/* shop list above the room buttons */
.shoppanel { display: flex; flex-direction: column; padding: 4px; max-height: 42vh; min-height: 120px; }
.shophdr { display: flex; align-items: center; gap: 6px; color: var(--gold); padding: 2px 4px 4px; }
.shophdr #shopTitle { flex: 1; font: 700 15px 'Matura', Georgia, serif; min-width: 0; overflow-wrap: anywhere; }
.shophdr #shopGold { color: var(--cyan); }
.shophdr button { padding: 0 7px; font-size: 16px; line-height: 1.2; }
.shoplist { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.shoprow { background: rgba(0,0,0,.25); border: 1px solid var(--edge-hi); }
.shoprow.open { background: rgba(244,208,63,.14); }
.shophead { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 2px 4px; border: 0; box-shadow: none; background: none; color: #fff; font-weight: 400; }
.shopimg { width: 32px; height: 32px; flex: none; object-fit: contain; image-rendering: pixelated; background: rgba(0,0,0,.4); border: 1px solid var(--edge-hi); }
.shopimg.nopic { font-size: 14px; }
.shopname { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--gold); font-weight: 700; overflow-wrap: anywhere; }
.shopstat { color: var(--cyan); font-weight: 400; font-size: 11px; }
.shopprice { color: var(--gold); font-weight: 700; }
.shopprice.poor { color: var(--bad); }
.shopacts { display: flex; gap: 4px; padding: 3px 4px 4px; }
.shopacts button { flex: 1; padding: 3px; }
.roombtns .wide { grid-column: 1 / -1; padding: 8px; font-size: 14px; }

/* ---- the game fits the window: room title, picture, log, command line and the whole map stay in view ---- */
@media (min-width: 901px) {
  #game .app { height: calc(100vh - 16px); min-height: 0; }
  #game .col { overflow: hidden; }
  #game .left { overflow-y: auto; }
  #game .roompic { aspect-ratio: auto; height: clamp(130px, 34vh, 300px); flex: none; }
  #game .log { flex: 1 1 0; min-height: 60px; max-height: none; }
  #game #mapWrap svg { max-height: 26vh; width: auto; max-width: 100%; margin: 0 auto; }
  #game .people { min-height: 0; overflow-y: auto; flex: 1 1 0; }
  #game .shoppanel { max-height: 30vh; }
  #game .parch.grow { min-height: 60px; }
}

/* pictures: faces, monsters and items on the floor */
img.portrait { object-fit: cover; background: #000; }
.monimg { width: 38px !important; height: 38px !important; }
.mon .portrait { width: 38px; height: 38px; }
.floor { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 3px 5px; color: #9fe6a0; font: 700 12px var(--pixel); }
.floor .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.floor .shopimg { width: 34px; height: 34px; }
.people .person .portrait { width: 38px; height: 38px; }
#statusStamina { color: var(--cyan); white-space: nowrap; }
.dmg { font-weight: 900; color: #fff; text-shadow: 0 0 1px #000; }

/* portraits in the creator and the character cards */
.portraits { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 4px 0; }
.portbtn { padding: 0; aspect-ratio: 1; overflow: hidden; }
.portbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portbtn[aria-pressed="true"] { outline: 3px solid var(--gold); outline-offset: -3px; }
.sumportrait { width: 96px; height: 96px; object-fit: cover; border: 2px solid var(--edge-hi); align-self: flex-start; }
.cardface { width: 84px; height: 84px; object-fit: cover; border: 2px solid var(--edge-hi); background: #000; }

/* ---- text colours and list rows, matched to screenshots of the original client ---- */
.log { color: #fff04a; }
.log .self   { color: #c9a6ff; }                   /* things you do, and attacks that miss you (lilac, with the ==> arrow) */
.log .hurt   { color: #ff4a4a; }                   /* you take damage: red */
.log .others { color: #b9f0ff; }                   /* other players fighting: light cyan */
.log .move   { color: #8fd0ff; }                   /* arrivals and departures */
.log .chat   { color: #fff27a; }                   /* talking */
.log .sys    { color: #8fe0ff; font-weight: 700; } /* game messages */
.log .echo   { color: #9a9a9a; font-weight: 400; } /* the command you just typed */
.log .arrow  { color: #b48cff; }
.log .self .dmg { color: #ff5a5a; font-weight: 900; text-shadow: none; }
.log .hurt .dmg { color: #ffb0b0; font-weight: 900; text-shadow: none; }
.log .dmg { font-weight: 900; }

/* the people / monster / floor list: wooden bars with a picture and a yellow name */
.people .person, .people .mon, .people .floor {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 3px 6px; color: #ffe21a; font: 700 14px var(--pixel);
  background: linear-gradient(rgba(150,70,25,.35), rgba(90,35,10,.4)), url('assets/ui/Tile.bmp'); border: 2px solid var(--edge); box-shadow: 0 0 0 1px var(--edge-hi) inset;
}
.people .person.me { cursor: default; }
.people .person .nm, .people .mon .nm, .people .floor .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.people .person > span:last-child:not(.nm) { flex: 1; }
.people .person:hover, .people .mon:hover, .people .floor:hover { color: #fff; }
.mon .hp { height: 5px; margin-top: 3px; }

/* hit point and stamina bars above the log */
.bars { display: flex; gap: 4px; flex: none; }
.bar { position: relative; height: 17px; background: #1a0a07; border: 1px solid var(--edge); overflow: hidden; }
.bar.hp { flex: 3; } .bar.sta { flex: 2; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .25s; }
.bar.hp i { background: linear-gradient(#e0406a, #a01040); }
.bar.sta i { background: linear-gradient(#58c858, #2a8a2a); }
.bar span { position: relative; display: block; text-align: center; font: 700 11px/17px var(--pixel); color: #fff; text-shadow: 1px 1px 0 #000; }

/* looking another player over */
.exbig.face { width: 140px; height: 140px; }
.extext.look p { color: #2fe6ff; font-size: 14px; line-height: 1.45; font-weight: 700; }

/* colours from the original client's video (V1.1): narration cyan, damage you take orange-red with a white number, skills blue, abilities lilac */
.log .self, .log .others { color: #5fd8ff; }
.log .hurt { color: #ff4a1e; }
.log .ability { color: #e8a0ff; }
.log .self .dmg, .log .self .dmgtext { color: #ff4a1e; font-weight: 700; }
.log .self .dmg { font-weight: 900; }
.log .hurt .dmg { color: #fff; font-weight: 900; }
.log .ability .dmg { color: #ff4a4a; font-weight: 900; }
.log .skill { color: #5a6bff; font-weight: 900; }
.log .arrow { color: #c9a6ff; }
.bar.mana { flex: 2; }
.bar.mana i { background: linear-gradient(#4a6cff, #1a2cb0); width: 0; }
.hint2 { color: #fff; font-weight: 400; margin-left: 6px; }

/* ---- round 5 tweaks ---- */
/* room at the bottom so a phone's address bar does not cover the buttons (about a third of an inch) */
body { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 901px) { #game .app { height: calc(100vh - 56px); height: calc(100dvh - 56px); } }

/* the logo is smaller (the stats window gets the room), and the logo and room-name banners use the dark red pattern, not solid black */
.logo { font-size: 21px; line-height: 1.05; padding: 2px 6px; }
.logo, .banner { background: linear-gradient(rgba(45, 6, 3, .8), rgba(45, 6, 3, .8)), url('assets/ui/Tile.bmp'); background-blend-mode: normal; }

/* bar numbers: centered, bold, thick dark outline */
.bar { display: flex; align-items: center; justify-content: center; }
.bar span { position: relative; z-index: 1; display: block; width: 100%; text-align: center; font: 900 12px/17px var(--pixel); letter-spacing: .04em; color: #fff;
  -webkit-text-stroke: 3px #000; paint-order: stroke fill;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 4px #000; }

/* only the damage number is red, not the words after it */
.log .self .dmgtext { color: inherit; font-weight: inherit; }
.log .self .dmg { color: #ff3b3b; }

/* the status box: nothing is cut off any more (hit points and stamina are on the bars) */
#statusStamina { display: none; }
.status { flex-wrap: wrap; gap: 4px 6px; }
.status .icons { margin-left: auto; flex: none; }
.icon { padding: 2px 5px; }

/* ---- round 6: light gray logo, deep red spells and map panels ---- */
.logo { color: #d6d6d6; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 0 0 5px #000; }
.parch { background: linear-gradient(rgba(45, 6, 3, .8), rgba(45, 6, 3, .8)), url('assets/ui/Tile.bmp'); color: #f4d03f; }
.parch h2 { color: var(--gold); text-shadow: none; }
.parch .area, .parch .list { color: #f4d03f; }
.parch .list .empty { color: #d9b25f; opacity: .85; }

/* ---- round 7: fixed-size room button box, equal bars, bold hit point bars on every list row, dialogs ---- */
.roombtns { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 34px; gap: 4px; padding: 6px; }
.roombtns button, .roombtns .slotbtn { height: 34px; padding: 2px 4px; }
.roombtns .slotbtn { border: 2px solid rgba(58, 13, 8, .55); background: rgba(0, 0, 0, .18); }
.roombtns button:disabled { opacity: .45; }
.bar.hp, .bar.sta, .bar.mana { flex: 1; }

/* hit point bars: a dark double border so they stand out on the wood */
.people .hp { display: block; height: 9px; margin-top: 3px; background: #1a0000; border: 2px solid #000; box-shadow: 0 0 0 1px #f0d080; }
.people .hp i { display: block; height: 100%; background: linear-gradient(#ff4a5a, #c01028); }
.people .person .nm, .people .mon .nm { display: block; }
.people .person .pn { display: block; }

.dialog p { font-weight: 400; margin: 0; line-height: 1.4; }
.dlgbtns { display: flex; gap: 8px; }
.dlgbtns button { flex: 1; padding: 8px; font-size: 13px; }

.overlay { z-index: 50; }

/* ---- round 8: gold in yellow, exp bar, player hit point bars without the light border ---- */
.goldamt { color: #ffe21a; font-weight: 700; }
.bar.exp { height: 15px; margin-top: 5px; }
.bar.exp i { background: linear-gradient(#e8b830, #a87810); }
.bar.exp span { font-size: 11px; line-height: 15px; }
.people .person .hp { box-shadow: none; }

/* ---- round 9: bigger name line, square god frame, deep red picture frames, narrower exp bar, 3 rows of unequipped items, smaller spells ---- */
:root { --frame: #4a0f0a; }
.who { gap: 10px; margin-bottom: 8px; }
.who .portrait, .godicon { width: 46px; height: 46px; }
.who-text { font-size: 18px; line-height: 1.2; padding: 2px 0; }
.godicon { border-radius: 0; }
.godimg, .godsm { border-radius: 0; }
.portrait, .godicon, .godimg, .godsm, .cardface, .sumportrait, .emblem, .exbig, .shopimg, .slot, .portbtn { border-color: var(--frame); }
.bar.exp { height: 12px; width: 80%; margin: 6px auto 0; border: 1px solid var(--edge-hi); }
.bar.exp span { font-size: 10px; line-height: 12px; }
.left .parch.grow { flex: 0 0 auto; min-height: 0; height: 78px; overflow-y: auto; }

.who { gap: 6px; }
.who .portrait, .godicon { width: 42px; height: 42px; }
.who-text { font-size: 16px; line-height: 1.15; text-wrap: balance; }

/* ---- the mini map: black, like the original ---- */
#mapWrap { background: #000; border: 2px solid var(--edge-hi); padding: 3px; }
#mapWrap .room.go:hover .tileframe { stroke: #ffffff; }
#mapWrap .room.go { cursor: pointer; }

/* ---- the bank: a small deposit/withdraw box, and the vault window ---- */
.dialog.small { max-width: 290px; }
.bankrows { display: flex; flex-direction: column; gap: 4px; font-weight: 400; }
.bankrows b { color: #ffe21a; }
.linkbtn { background: none; border: 0; box-shadow: none; padding: 0; color: #ffe21a; font: 700 12px var(--pixel); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: #fff; }
.vault { position: fixed; z-index: 45; width: 330px; max-width: calc(100vw - 8px); padding: 8px; border: 2px solid var(--edge-hi);
  background: linear-gradient(rgba(45, 6, 3, .94), rgba(45, 6, 3, .94)), url('assets/ui/Tile.bmp'); box-shadow: 0 6px 18px rgba(0, 0, 0, .7); display: flex; flex-direction: column; gap: 6px; }
.vhdr { display: flex; align-items: center; gap: 8px; color: var(--gold); }
.vhdr .vtitle { font: 700 20px 'Matura', Georgia, serif; flex: 1; }
.vhdr .vgold { color: #ffe21a; font-weight: 700; }
.vhdr button { padding: 0 8px; font-size: 16px; line-height: 1.3; }
.vault .slots { grid-template-columns: repeat(7, 1fr); }
.vault .vnote { margin: 0; font-weight: 400; font-size: 11px; line-height: 1.35; color: #e8d8a8; }
.vault .vnote #vaultCount { color: #ffe21a; font-weight: 700; }

/* ---- guild spells ---- */
.spellbox { width: 340px; }
.spellrows { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.spellrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 4px 6px; background: rgba(0, 0, 0, .28); border: 1px solid var(--frame); color: #fff; font-weight: 400; }
.spellrow .sname2 { color: var(--gold); font-weight: 700; }
.spellrow .slevel { color: var(--cyan); font-weight: 400; font-size: 11px; margin-left: 8px; }
.spellrow .snote { grid-column: 1 / -1; font-size: 11px; opacity: .85; }
.spellrow.dim { opacity: .7; display: block; }
.spellrow button { padding: 3px 8px; }
.spellknown { color: var(--gold); font-weight: 700; padding: 1px 0; }
