/* Roman Empire: layout follows the original 480x320 mobile client (art from /assets/ui). The stage is scaled to fit the window. */
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none; }
#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
#stage { position: relative; width: 480px; height: 320px; flex: none; overflow: hidden; background: #000; color: #fff;
  font: 12px/1.25 Arial, Verdana, sans-serif; transform-origin: center center; }
#stage * { box-sizing: border-box; }
#stage b, #stage .y { color: #fffc17; }
#stage .y { font-weight: bold; }
#stage img { border: 0; }
#stage a { color: #fffc17; }
:focus-visible { outline: 1px dashed #fffc17; outline-offset: 1px; }
.boot { position: absolute; inset: 0; display: grid; place-items: center; color: #fffc17; font-size: 14px; text-align: center; padding: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { opacity: .75; }
.good { color: #7dff7d; } .bad { color: #ff8a80; }
.n { text-align: right; }

/* ------------------------------------------------------------ top bar and menu */
#top, #foot { position: absolute; left: 0; width: 480px; z-index: 20; background: url(/assets/ui/frame/mud.jpg) center / 100% 100% no-repeat; }
#top { top: 0; height: 35px; display: flex; align-items: center; padding: 0 4px; gap: 4px; }
#top .nat { width: 30px; height: 30px; flex: none; object-fit: contain; }
#top .lord { width: 80px; flex: none; font-weight: bold; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
#top .castle { width: 108px; flex: none; height: 20px; background: #fff; color: #000; border-radius: 4px; font: bold 13px/20px Arial, sans-serif; padding: 0 22px 0 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
#top .castle::after { content: ""; position: absolute; right: 2px; top: 3px; width: 15px; height: 15px; background: url(/assets/ui/button/drop_down.png) center no-repeat; }
#top .stat { display: flex; align-items: center; gap: 0; font-weight: bold; font-size: 13px; color: #fffc17; min-width: 34px; }
#top .stat img { width: 22px; height: 26px; object-fit: contain; flex: none; }
#top .ally { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; font-weight: bold; font-size: 13px; color: #fff; }
#top .ally span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#top .ally img { width: 32px; height: 24px; object-fit: contain; flex: none; }
#top .home { flex: none; width: 30px; height: 30px; border: 0; padding: 0; background: url(/assets/ui/button/home.gif) center no-repeat; cursor: pointer; }

#foot { top: 280px; height: 40px; }
#foot button { position: absolute; top: 0; width: 48px; height: 40px; padding: 0; border: 0; background: url(/assets/ui/frame/mc.png) center 1px / 40px 38px no-repeat; cursor: pointer; color: #fffc17;
  font: bold 12px Arial, sans-serif; text-shadow: 0 0 2px #000, 1px 1px 1px #000; }
#foot button img.mi { position: absolute; left: 0; top: 0; width: 48px; height: 40px; }
#foot button span.lb { position: absolute; left: 0; right: 0; bottom: -1px; }
#foot button.off img.mi { filter: grayscale(.7) brightness(.8); }
#foot button.cur { filter: brightness(1.25); }
#foot button img.newmail { position: absolute; left: 14px; top: -9px; width: 22px; height: 18px; object-fit: contain; }

/* ------------------------------------------------------------ city */
#city { position: absolute; left: 0; top: 35px; width: 480px; height: 250px; z-index: 1; background-repeat: no-repeat; background-position: top left; }
.res2 { position: absolute; left: 3px; top: 2px; display: flex; gap: 2px; z-index: 3; background: rgba(3, 13, 17, .36); padding: 0 3px; height: 23px; align-items: center; }
.res2 .r { display: flex; align-items: center; height: 23px; min-width: 56px; }
.res2 .r img { width: 25px; height: 23px; object-fit: contain; flex: none; }
.res2 .r b { color: #fff; font-size: 11px; }
.res2 .r.full b { color: #ff6b5e; }
.qlines { position: absolute; left: 0; top: 27px; width: 195px; z-index: 3; background: rgba(3, 13, 17, .36); }
.qline { display: flex; align-items: center; height: 26px; padding-left: 2px; gap: 3px; font-size: 12px; white-space: nowrap; }
.qline > span:first-child { min-width: 0; flex: 0 1 auto; }
.qline > span { overflow: hidden; text-overflow: ellipsis; }
.qline .plus, button.plus:not(.xbtn) { flex: none; width: 24px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; color: #fc0; font: bold 24px/24px Arial, sans-serif; text-shadow: 1px 1px 0 #7a4b00; }
.qline .cd { color: #fffc17; }
.zonetitle { position: absolute; width: 70px; height: 20px; z-index: 3; background: url(/assets/ui/bg/bg_tip3.png) 0 0 / 100% 100% no-repeat; border: 0; padding: 0; line-height: 20px;
  text-align: center; font: bold 12px/20px Arial, sans-serif; color: #fffc17; cursor: pointer; }
.zonearea { position: absolute; z-index: 2; border: 0; padding: 0; background: transparent; cursor: pointer; }
.zonearea:hover { background: rgba(255, 255, 255, .08); }
.protect { position: absolute; z-index: 3; right: 4px; top: 30px; display: flex; flex-direction: row-reverse; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; }
.protect .pico { width: 24px; height: 24px; display: block; }

/* ------------------------------------------------------------ sub views */
.pv { position: absolute; left: 0; top: 35px; width: 480px; height: 250px; z-index: 5; background: #c9b58b url(/assets/ui/bg/view.jpg) top left no-repeat; overflow: hidden; }
.pv .tabbar { position: absolute; left: 0; top: 0; width: 480px; height: 30px; display: flex; align-items: center; justify-content: flex-end; background: rgba(48, 36, 24, .72); z-index: 2; }
.pv .back { position: absolute; left: 2px; top: 0; width: 44px; height: 30px; border: 0; padding: 0; cursor: pointer; background: url(/assets/ui/button/back_button.png) 4px 0 no-repeat; }
.pv .tab { flex: none; height: 29px; min-width: 66px; padding: 0 8px; border: 0; background: none; color: #fff; font: bold 14px/29px Arial, sans-serif; cursor: pointer; text-align: center; }
.pv .tab.on { color: #fffc17; background: url(/assets/ui/bg/b.png) repeat-x 0 0 / 3px 29px; }
.pv .body { position: absolute; left: 0; top: 30px; width: 480px; height: 220px; background: rgba(70, 48, 20, .28); }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 8px; scrollbar-width: thin; scrollbar-color: #5a432f rgba(0, 0, 0, .25); font-size: 13px; text-shadow: 1px 1px 0 rgba(0, 0, 0, .55); }
.scroll::-webkit-scrollbar { width: 6px; } .scroll::-webkit-scrollbar-thumb { background: #5a432f; border-radius: 3px; }
.band { background: rgba(48, 36, 24, .78); padding: 3px 6px; margin: 0 -8px 4px; font-weight: bold; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.band .grow { flex: 1; }
.note { margin: 6px 0; font-size: 13px; }
.stack > * + * { margin-top: 5px; }

/* buttons */
.fbtn { flex: none; min-width: 66px; height: 26px; padding: 0 6px; border: 0; cursor: pointer; background: url(/assets/ui/button/redbar.png) center / 100% 100% no-repeat; color: #fffc17; font: bold 13px/26px Arial, sans-serif; text-align: center; text-shadow: 1px 1px 0 #000; }
.fbtn:disabled { filter: grayscale(.85) brightness(.75); cursor: not-allowed; }
.fbtn.wide { min-width: 96px; }
.xbtn { width: 28px; height: 24px; border: 0; padding: 0; cursor: pointer; background: center / contain no-repeat; flex: none; }
.xbtn.plus { background-image: url(/assets/ui/button/plus.png); } .xbtn.minus { background-image: url(/assets/ui/button/minus.png); } .xbtn.max { width: 38px; background-image: url(/assets/ui/button/max.png); }
.xbtn.more { background-image: url(/assets/ui/button/plus.png); width: 26px; }
select.sel, input.inp, textarea.inp { background: #fff; color: #000; border: 1px solid #888; border-radius: 4px; font: 13px Arial, sans-serif; height: 24px; padding: 0 4px; text-shadow: none; min-width: 0; -webkit-user-select: text; user-select: text; }
textarea.inp { height: 90px; width: 100%; padding: 4px; resize: none; }
input.inp.num { width: 64px; text-align: center; }
.err { color: #ff8a80; min-height: 15px; }

/* rows: facility / unit / tech lists */
.row { display: flex; gap: 6px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .22); align-items: flex-start; }
.row .ic { flex: none; width: 54px; height: 54px; border: 1px solid #3a2c1a; background: #2a2118; object-fit: cover; }
.row .ic.sm { width: 40px; height: 40px; }
.row .main { flex: 1; min-width: 0; }
.row h4 { margin: 0; font-size: 14px; color: #fffc17; }
.row h4 .lv { color: #fff; font-weight: normal; }
.row p { margin: 1px 0 2px; font-size: 12px; }
.row .req { font-size: 12px; } .row .req.bad b { color: #ff8a80; }
.cost { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; font-weight: bold; font-size: 13px; margin-top: 2px; }
.cost span { display: inline-flex; align-items: center; gap: 1px; }
.cost img { width: 24px; height: 22px; object-fit: contain; }
.cost .short { color: #ff6b5e; }
.row .act { flex: none; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; align-self: center; }
.row .act .qty { display: flex; align-items: center; gap: 2px; }
.shead .act { display: flex; gap: 4px; align-items: center; flex: none; }
.qrow { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* tables (heroes, ranking, alliance) */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: rgba(48, 36, 24, .78); font-size: 14px; padding: 3px 4px; text-align: left; position: sticky; top: -4px; z-index: 1; }
.tbl td { padding: 3px 4px; vertical-align: middle; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.tbl td.n, .tbl th.n { text-align: right; }
.tbl tr.me td { background: rgba(255, 252, 23, .18); }
.hp { position: relative; width: 56px; text-align: center; }
.hp img.pt { width: 52px; height: 52px; display: block; border: 1px solid #3a2c1a; margin: 0 auto; }
.hp img.rk { position: absolute; left: 2px; bottom: 17px; width: 17px; height: 25px; }
.hp b { display: block; font-size: 13px; text-align: center; }

/* hero detail */
.hd { display: flex; gap: 8px; }
.hd .left { width: 76px; flex: none; text-align: center; position: relative; }
.hd .left img.pt { width: 76px; height: 76px; border: 1px solid #3a2c1a; display: block; }
.hd .left img.rk { position: absolute; left: 2px; top: 48px; width: 20px; height: 29px; }
.hd .stats { flex: 1; min-width: 0; }
.hd .kv { display: flex; gap: 8px; } .hd .kv span:first-child { width: 70px; }
.bar { height: 8px; background: rgba(0, 0, 0, .45); border: 1px solid #3a2c1a; margin: 3px 0; }
.bar > i { display: block; height: 100%; background: #e0b84c; }

/* world map (original layout: info + search left, 7x7 terrain view right) */
.pv.mapview .tabbar { display: none; }
.pv.mapview .body, .has-ticker .pv.mapview .body { top: 0; height: 250px; }
.pv.mapview .scroll { padding: 0; overflow: hidden; }
.mapleft { position: absolute; left: 0; top: 0; width: 230px; height: 250px; }
.maphead { position: relative; height: 28px; background: rgba(48, 36, 24, .78); }
.maphead .back { position: absolute; left: 0; top: 0; width: 40px; height: 28px; border: 0; padding: 0; cursor: pointer; background: url(/assets/ui/button/back_button.png) 2px -1px no-repeat; }
.maptitle { position: absolute; left: 42px; right: 2px; top: 0; height: 28px; line-height: 28px; font-weight: bold; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapinfo { position: relative; height: 82px; padding: 3px 4px; background: rgba(70, 48, 20, .25); }
.mapinfo .note { margin: 4px 0; }
.mapline { display: flex; align-items: center; gap: 2px; font-size: 12px; height: 20px; white-space: nowrap; overflow: hidden; }
.mapmenu { position: absolute; right: 2px; bottom: 1px; display: flex; gap: 2px; }
.mbtn { position: relative; width: 46px; height: 45px; border: 0; padding: 0; background: none; cursor: pointer; }
.mbtn img { width: 38px; height: 40px; display: block; margin: 0 auto; }
.mbtn span { position: absolute; left: 0; right: 0; bottom: -1px; color: #fffc17; font: bold 12px Arial, sans-serif; text-shadow: 1px 1px 0 #000, 0 0 2px #000; }
.mapsearch { position: absolute; left: 0; top: 112px; width: 230px; height: 138px; }
.stabhead { width: 71px; height: 22px; background: url(/assets/ui/button/tab_a.png) center / 100% 100% no-repeat; color: #fffc17; font: bold 13px/22px Arial, sans-serif; text-align: center; }
.homebtn { position: absolute; left: 200px; top: 0; width: 26px; height: 22px; border: 0; padding: 0; cursor: pointer; background: url(/assets/ui/button/home.gif) center no-repeat; }
.mapform { position: absolute; left: 0; top: 22px; width: 122px; height: 116px; padding: 4px 3px; background: rgba(70, 48, 20, .25); display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.mapform .qrow { flex-wrap: nowrap; gap: 2px; }
.mapform input[type=number] { width: 38px; padding: 0 2px; }
.mapform input[type=text] { width: 76px; }
.mapform .fbtn { min-width: 62px; height: 22px; line-height: 22px; align-self: flex-start; }
.arrows { position: absolute; left: 124px; top: 26px; width: 105px; height: 105px; }
.arrow { position: absolute; width: 35px; height: 35px; border: 0; padding: 0; cursor: pointer; background: center / contain no-repeat; }
.arrow.u { left: 35px; top: 0; background-image: url(/assets/ui/button/arrow_u.png); } .arrow.d { left: 35px; top: 70px; background-image: url(/assets/ui/button/arrow_d.png); }
.arrow.l { left: 0; top: 35px; background-image: url(/assets/ui/button/arrow_l.png); } .arrow.r { left: 70px; top: 35px; background-image: url(/assets/ui/button/arrow_r.png); }
.mapright { position: absolute; left: 235px; top: 0; width: 245px; height: 250px; background: url(/assets/ui/bg/map.jpg) 0 0 / 245px 250px; overflow: hidden; }
.mapterrain { position: relative; width: 245px; height: 245px; }
.mtile { position: absolute; width: 35px; height: 35px; border: 0; padding: 0; background: none; cursor: pointer; }
.mtile img { width: 35px; height: 35px; display: block; }
.mtile:hover { background: rgba(255, 255, 255, .12); }
.mtile.cd img { filter: grayscale(.9) brightness(.7); }
.mtile.prot::after { content: ""; position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; background: url(/assets/ui/res/protect.png) center / contain no-repeat; }
.mapaim { position: absolute; width: 35px; height: 35px; background: url(/assets/ui/bg/SBlueAiming.png) center no-repeat; pointer-events: none; }
.troopgrid { display: grid; grid-template-columns: 1fr 70px; gap: 3px 6px; align-items: center; margin-top: 4px; }
.troopgrid input { width: 70px; }

/* messages */
.mrow { display: flex; gap: 6px; padding: 5px 0; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .22); cursor: pointer; align-items: center; background: none; width: 100%; text-align: left; color: #fff; font: 13px Arial, sans-serif; text-shadow: 1px 1px 0 rgba(0, 0, 0, .55); }
.mrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow.unread .grow { color: #fffc17; font-weight: bold; }
.msgbody { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0, 0, 0, .3); padding: 6px; -webkit-user-select: text; user-select: text; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.win { color: #7dff7d; font-weight: bold; } .lose { color: #ff8a80; font-weight: bold; }
.badge { display: inline-block; background: #c0392b; color: #fff; border-radius: 8px; font-size: 10px; padding: 0 4px; margin-left: 3px; }

/* auth */
.auth { position: absolute; inset: 0; z-index: 30; background: #000 url(/assets/ui/bg/1.jpg) top left no-repeat; }
.auth form { position: absolute; padding: 6px 12px 8px; background: rgba(3, 13, 17, .78); border: 1px solid #5a432f; border-radius: 6px; }
.auth form.login { left: 130px; top: 104px; width: 220px; }
.auth form.reg { left: 40px; top: 96px; width: 400px; }
.auth form.reg .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.auth label { display: block; font-size: 12px; margin: 5px 0 1px; color: #fffc17; font-weight: bold; }
.auth input[type=text], .auth input[type=password] { width: 100%; }
.auth .tabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 4px; }
/* the story after sign-up, and the nation screen */
.story { position: absolute; inset: 0; z-index: 31; background: #000; }
.story-pic { position: absolute; inset: 0; background: center / cover no-repeat; }
.story-box { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: rgba(0, 0, 0, .72); }
.story-txt { margin: 0 0 6px; font-size: 13px; line-height: 1.4; }
.story-btns { display: flex; gap: 8px; justify-content: flex-end; }
.nation-pick .npanel { position: absolute; left: 10px; right: 10px; top: 8px; padding: 6px 10px; background: rgba(3, 13, 17, .82); border: 1px solid #5a432f; border-radius: 6px; }
.dhudrib { margin: 0 0 4px; font-size: 13px; }
.races { display: flex; gap: 8px; justify-content: center; }
.race { flex: 1; max-width: 130px; background: rgba(0, 0, 0, .3); border: 2px solid #5a432f; border-radius: 6px; color: #fff; padding: 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.race > img { width: 100%; max-width: 120px; height: auto; }
.race[aria-pressed=true] { border-color: #fffc17; box-shadow: 0 0 6px #fffc17; }
.auth .go { margin-top: 6px; display: block; width: 100%; background: url(/assets/ui/button/red_big.png) center / 100% 100% no-repeat; height: 32px; border: 0; color: #fffc17; font: bold 16px/32px Arial, sans-serif; cursor: pointer; }
.auth .go:disabled { filter: grayscale(.8); }
.auth .hint { font-size: 11px; opacity: .8; margin-top: 2px; }

/* overlays */
#toasts { position: absolute; left: 60px; right: 60px; bottom: 44px; z-index: 60; display: grid; gap: 3px; pointer-events: none; }
.toast { background: rgba(3, 13, 17, .85); border: 1px solid #fffc17; color: #fffc17; padding: 2px 8px; font-weight: bold; text-align: center; font-size: 12px; }
.toast.bad { border-color: #ff6b5e; color: #ff8a80; }
.modal { position: absolute; inset: 0; z-index: 70; background: rgba(3, 13, 17, .6); display: grid; place-items: center; }
.dlg { width: 300px; background: #c9b58b url(/assets/ui/bg/view.jpg) center; border: 2px solid #3a2c1a; padding: 12px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #000; font-size: 14px; }
.dlg-btns { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.ico { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.ico.flag { width: 30px; height: 22px; }

/* ------------------------------------------------------------ shared bits added with the shop, chat and arena */
.center { text-align: center; justify-content: center; }
.small { font-size: 11px; }
.pre { white-space: pre-line; }
.dlg.wide { width: 380px; max-height: 290px; display: flex; flex-direction: column; padding: 6px 10px 8px; }
.dlg-title { font-weight: bold; color: #fffc17; font-size: 15px; margin-bottom: 4px; }
.dlg-body { overflow-y: auto; text-align: left; font-size: 13px; min-height: 0; flex: 1; }
.dlg-body .row .act { align-self: center; }
.dlist { max-height: 170px; }
.helptext p { margin: 0 0 6px; }
.kvform { display: grid; grid-template-columns: 90px 1fr; gap: 4px 6px; align-items: center; margin: 4px 0; }
.kvform label { color: #fffc17; font-weight: bold; }
.rk0 { color: #fff; } .rk1 { color: #5efb6e; } .rk2 { color: #fffc17; } .rk3 { color: #6fa0ff; }
.rk0 .muted, .rk1 .muted, .rk2 .muted, .rk3 .muted { color: inherit; }
img.iic { flex: none; width: 48px; height: 48px; border: 1px solid #3a2c1a; background: #2a2118; object-fit: contain; }
.price { display: inline-flex; align-items: center; gap: 2px; font-weight: bold; color: #fff; }
.price img { width: 22px; height: 22px; }
.band img.ico { width: 20px; height: 20px; }

/* ticker: the latest chat line, above the menu */
#ticker { position: absolute; left: 0; top: 262px; width: 480px; height: 18px; z-index: 21; background: rgba(0, 0, 0, .55); padding: 0 4px; cursor: pointer;
  font: bold 12px/18px Arial, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ticker .cl { overflow: hidden; text-overflow: ellipsis; }

/* chat */
.syncbox { position: absolute; left: 52px; top: 0; height: 30px; display: flex; align-items: center; gap: 4px; font-size: 13px; color: #fff; cursor: pointer; }
.syncbox input { width: 16px; height: 16px; margin: 0; accent-color: #555; }
.scroll.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chatlist { flex: 1; overflow-y: auto; padding: 2px 4px; scrollbar-width: thin; }
.cl { font-weight: bold; font-size: 13px; line-height: 17px; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.cl.world { color: #7cf27c; } .cl.alliance { color: #f5a3f5; } .cl.private { color: #fff; } .cl.system { color: #fff; }
.cl.private .who, .cl.system .who { color: #fffc17; }
.cl button.who { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-shadow: inherit; }
.cl button.who:hover { text-decoration: underline; }
.cl .modstar { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.cl.notice { color: #ffd84a; font-size: 14px; }
.cl.muted { color: #9a9a9a; font-weight: normal; }
.chatin { flex: none; display: flex; height: 28px; align-items: center; gap: 0; background: rgba(0, 0, 0, .35); border-top: 1px solid #8a6a3a; border-bottom: 1px solid #8a6a3a; }
.chatin .chan { flex: none; width: 108px; height: 26px; border: 0; padding: 0 22px 0 6px; text-align: left; background: rgba(90, 80, 60, .9) url(/assets/ui/button/drop_up.png) right 5px center no-repeat;
  color: #fffc17; font: bold 14px Arial, sans-serif; cursor: pointer; }
.chatin .inp { height: 24px; border-radius: 3px; }
.chatin .to { width: 72px; margin-left: 3px; }
.chatin .msg { flex: 1; margin-left: 3px; }
.chatin .enter { flex: none; width: 36px; height: 26px; border: 0; margin: 0 2px; background: url(/assets/ui/button/send.png) center / 33px 26px no-repeat; cursor: pointer; }
.chatsys { flex: none; height: 38px; overflow: hidden; padding: 1px 4px; background: rgba(0, 0, 0, .25); }

/* arena: Visit card table */
.scroll.visit { overflow: hidden; }
.vtop { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.vtop .sel { width: 180px; }
.vtop .hand { font-size: 12px; display: inline-flex; align-items: center; flex-wrap: wrap; }
.vmain { display: flex; gap: 6px; }
.cards { display: grid; grid-template-columns: repeat(5, 60px); grid-auto-rows: 60px; gap: 5px; }
.card { position: relative; width: 60px; height: 60px; padding: 0; border: 2px solid #8a8a8a; background: #2a2118; cursor: pointer; }
.card.new { border-color: #c9a227; }
.card.pick { border-color: #3cff3c; box-shadow: 0 0 6px #3cff3c; }
.card.drop { border-color: #ff3c3c; opacity: .45; }
.card.ghost { opacity: .6; border-style: dashed; }
.card.empty.deal { border-style: dashed; }
.card.empty { border-color: rgba(138, 138, 138, .6); background: rgba(80, 60, 40, .35); cursor: default; }
.card img.pt { width: 100%; height: 100%; object-fit: cover; display: block; }
.card img.rk { position: absolute; left: 3px; bottom: 3px; width: 18px; height: 26px; }
.vside { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.scroll.visit .band { margin-bottom: 2px; padding: 1px 6px; }
.vside .fbtn { min-width: 92px; }
.timer { display: flex; align-items: center; gap: 2px; font: bold 16px Georgia, serif; color: #fff; }
.timer .hurry { border: 0; background: none; color: #fc0; font: bold 24px/20px Arial, sans-serif; cursor: pointer; padding: 0 2px; text-shadow: 1px 1px 0 #7a4b00; }
.timer .hurry:disabled { opacity: .4; cursor: default; }

/* arena: Recruit (the bar) */
.pv .body.recruitbg { background: #2a2118 url(/assets/ui/bg/recruit.jpg) center 40% / cover no-repeat; }
.drink .cost { margin: 0; }
.drink { width: 300px; margin: 2px auto 0; background: #232323; border: 2px solid #6b6b6b; padding: 4px 10px; text-align: center; color: #fffc17; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.drink p { margin: 0; font-size: 12px; }
.drink .who { position: relative; width: 54px; height: 54px; border: 2px solid #a08a1e; background: #10161c; overflow: hidden; }
.drink .who img.shadow { width: 100%; height: 160%; object-fit: cover; object-position: top; filter: brightness(.35); }
.drink .who img.pt { width: 100%; height: 100%; object-fit: cover; }
.drink .who img.rk { position: absolute; left: 2px; bottom: 2px; width: 16px; height: 23px; }
.drink .cost { justify-content: center; color: #fff; }
.note.center { margin: 0 0 3px; }

/* hero picker on Camp and Research */
.band.hpick { gap: 6px; }
.band.hpick .sel { flex: 1; min-width: 0; max-width: 330px; }

/* arena: Battle (hero duels) */
.duelme { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.duelme .sel { width: 220px; }
.duelme .small { font-size: 12px; }
.duelme .hp { position: relative; flex: none; width: 56px; }
.duelme .hp img.pt { width: 54px; height: 54px; border: 2px solid #a08a1e; }
.duelme .hp img.rk { position: absolute; left: 3px; bottom: 3px; width: 16px; height: 23px; }

/* hero detail with equipment */
.hdetail { display: flex; gap: 6px; }
.hleft { flex: 1; min-width: 0; }
.hleft p.small { margin: 0 0 4px; }
.gear { position: relative; flex: none; width: 160px; height: 208px; }
.gear img.shadow { position: absolute; left: 47px; top: 6px; width: 66px; height: 140px; opacity: .6; }
.gslot { position: absolute; width: 44px; height: 44px; padding: 0; border: 2px solid #8a8a8a; background: rgba(42, 33, 24, .75) url(/assets/ui/bg/slot.png) center / cover; cursor: pointer; }
.gslot img.giic { width: 100%; height: 100%; object-fit: contain; display: block; }
.gslot .gl { font-size: 10px; color: #ddd; }
.gslot.book { left: 0; top: 0; } .gslot.armor { left: 58px; top: 34px; }
.gslot.weapon { left: 0; top: 80px; } .gslot.ring { left: 116px; top: 80px; } .gslot.mount { left: 58px; top: 140px; }

/* shop */
.subtabs { display: flex; gap: 0; margin: -4px -8px 4px; background: rgba(48, 36, 24, .6); }
.stab { height: 26px; min-width: 76px; border: 0; background: none; color: #fff; font: bold 14px/26px Arial, sans-serif; cursor: pointer; }
.stab.on { color: #fffc17; background: url(/assets/ui/bg/b.png) repeat-x 0 0 / 3px 26px; }
.row .hp { flex: none; }
.has-ticker .pv .body { height: 197px; }
.has-ticker #toasts { bottom: 62px; }

/* ------------------------------------------------------------ screens matched to the original screenshots */
.purse { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-weight: bold; margin: 0 0 3px; }
.purse img.ico { width: 18px; height: 18px; margin-left: 6px; }
.fbtn.sm { min-width: 48px; height: 22px; line-height: 22px; font-size: 12px; }
.iname { color: #fff; }
.linkbtn { border: 0; padding: 0; background: none; color: #fffc17; font: bold 13px Arial, sans-serif; cursor: pointer; text-align: left; text-shadow: inherit; }
.date { color: #fffc17; font-weight: bold; font-size: 12px; white-space: nowrap; }
.w { color: #fff !important; }

/* shop rows: icon, then a dark box with name, price and button over the description */
.srow { display: flex; gap: 6px; margin: 0 0 4px; align-items: stretch; }
.srow > img.iic, .srow > .hp { flex: none; width: 48px; height: 48px; }
.srow > .hp img.pt { width: 48px; height: 48px; }
.srow > .hp img.rk { bottom: 2px; }
.sbox { flex: 1; min-width: 0; background: rgba(40, 36, 30, .55); padding: 2px 6px 3px; }
.shead { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.sname { flex: 1; min-width: 0; font-weight: bold; font-size: 14px; }
.shead .price { width: 76px; flex: none; }
.shead .fbtn { min-width: 76px; }
.shead .qty { color: #fff; font-weight: normal; }
.sdesc { font-size: 12px; color: #fff; }
img.iic.gold { object-fit: none; }

/* world map extras */
.maptitle { font-weight: normal; color: #fff; font-size: 14px; }
.mapline.big { font-size: 15px; height: 26px; }
.mapline.big img.ico { width: 26px; height: 26px; }
.mapmenu .mbtn { width: 44px; }

/* simple grid tables (favourites, alliance, ranking) */
.thead, .trow { display: grid; align-items: center; gap: 4px; }
.thead { font-weight: bold; font-size: 14px; background: rgba(48, 36, 24, .78); margin: -4px -8px 3px; padding: 4px 8px; position: sticky; top: -4px; z-index: 2; }
.trow { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .15); font-size: 13px; }
.trow.me { background: rgba(255, 252, 23, .14); }
.fav { grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, .6fr) 290px; }
.fav .btns { display: flex; gap: 4px; justify-content: flex-end; }
.mcols { grid-template-columns: 1.3fr 80px 80px 70px 70px; }

/* alliance list */
.barsearch { position: absolute; left: 46px; top: 0; height: 30px; display: flex; align-items: center; gap: 4px; font: bold 14px Arial, sans-serif; }
.barsearch .inp { width: 120px; height: 22px; }
.barsearch .fbtn { min-width: 60px; height: 22px; line-height: 22px; }
.acols { grid-template-columns: 1fr 70px 60px 72px 28px; display: grid; align-items: center; gap: 4px; }
.arow { padding: 3px 0 4px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.aname { display: flex; align-items: center; gap: 4px; font-weight: bold; overflow: hidden; white-space: nowrap; }
.aname span { overflow: hidden; text-overflow: ellipsis; }
.anotice { font-weight: bold; font-size: 12px; color: #fff; overflow-wrap: anywhere; margin-top: 1px; }
.ainfo { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 6px; }
.aflag { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 120px; }
.aflag img.flag { width: 60px; height: 44px; }
.ainfo .kvform { flex: 1; }
.stack textarea.inp { height: 44px; }

/* alliance Hall: technology tree */
.hallbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; font-size: 13px; }
.hallbar .inp.num { width: 76px; }
.atree { position: relative; height: 282px; margin: 0 -2px; background: rgba(40, 36, 30, .45); }
.atitle { position: absolute; left: 0; right: 0; top: 2px; text-align: center; font-weight: bold; font-size: 13px; }
.abox { position: absolute; top: 20px; bottom: 4px; background: rgba(40, 36, 30, .5); }
.abox.b1 { left: 4px; width: 182px; } .abox.b2 { left: 194px; width: 72px; } .abox.b3 { left: 274px; width: 182px; }
.anode { position: absolute; width: 90px; height: 50px; }
.alabel { margin: 0 auto; width: 76px; height: 16px; line-height: 16px; background: rgba(30, 30, 30, .8); text-align: center; font-weight: bold; font-size: 12px; white-space: nowrap; overflow: hidden; }
.alv { position: absolute; left: 2px; top: 18px; font-size: 11px; font-weight: bold; }
.aarrow { position: absolute; left: 34px; top: 17px; width: 22px; height: 33px; background: url(/assets/ui/button/arrow_d.png) center bottom / 22px 22px no-repeat; }
.aq { position: absolute; left: 55px; top: 18px; width: 22px; height: 22px; border: 0; padding: 0; background: url(/assets/ui/button/q.png) center / contain no-repeat; cursor: pointer; }
.anode.locked .alabel { color: #a09a90; }
.anode.ready .alabel { color: #fffc17; }

/* ranking */
.rk { grid-template-columns: 1fr 28px; position: relative; }
.rkstats, .rkmenu { grid-column: 1; grid-row: 1; }
.rkmenu { display: flex; gap: 6px; justify-content: flex-end; padding-right: 4px; background: rgba(40, 36, 30, .3); }
.rkmenu .fbtn { min-width: 76px; }
.rk > .xbtn { grid-column: 2; grid-row: 1; }
.xbtn.more.less { background-image: url(/assets/ui/button/minus.png); }
.rkh { display: grid; grid-template-columns: 22px 1.7fr 30px 36px 36px 36px 56px 1fr; gap: 3px; align-items: center; }
.rkl { display: grid; grid-template-columns: 22px 1.3fr 70px 66px 1fr 64px; gap: 3px; align-items: center; }
.rkt { display: grid; grid-template-columns: 22px 1.4fr 70px 1.2fr; gap: 3px; align-items: center; }
.thead.rkh, .thead.rkl, .thead.rkt { padding-right: 36px; font-size: 12px; }
.rnum { color: #fffc17; font-size: 15px; text-align: center; }
.rhero { display: flex; align-items: center; gap: 3px; font-weight: bold; white-space: nowrap; overflow: hidden; }
.rpt { position: relative; flex: none; width: 30px; height: 30px; }
.rpt img.pt { width: 30px; height: 30px; border: 1px solid #a08a1e; display: block; }
.rpt img.rk { position: absolute; left: 0; bottom: 0; width: 10px; height: 14px; }

/* mail and reports */
.mrow .who { width: 100px; flex: none; color: #fffc17; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listback { border: 0; background: none; color: #fffc17; font: bold 12px Arial, sans-serif; cursor: pointer; padding: 2px 0; text-shadow: inherit; }
.rhead { background: rgba(48, 36, 24, .78); margin: 2px 0 4px; padding: 3px 6px; font-size: 13px; color: #fff; }
.rline { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.rline .grow { flex: 1; min-width: 0; }
.rband { background: rgba(48, 36, 24, .78); text-align: center; color: #fffc17; font-weight: bold; font-size: 14px; margin: 4px -8px 3px; padding: 2px; }
.vsnames { display: grid; grid-template-columns: 1fr 40px 1fr; text-align: center; font-size: 14px; }
.vsnames span { color: #fff; }
.vs { display: grid; grid-template-columns: 1fr 64px 64px 1fr; gap: 6px; align-items: center; }
.hstats { font-size: 13px; } .hstats.r { text-align: right; }
.rpic { position: relative; width: 60px; height: 60px; border: 1px solid #a08a1e; background: #10161c; }
.rpic.empty { border-color: transparent; background: none; }
.rpic img.pt { width: 100%; height: 100%; display: block; object-fit: cover; }
.rpic img.rk { position: absolute; left: 0; bottom: 0; width: 18px; height: 26px; }
.rcols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.ssec { margin-top: 6px; }
.slist { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 13px; }
.newsline { font-size: 13px; padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.msubj { color: #fffc17; font-weight: bold; margin: 4px 0; }
.msgbody { background: none; padding: 0; font-weight: bold; }
.writemail { display: grid; grid-template-columns: 60px 1fr; gap: 4px; align-items: center; }
.writemail textarea, .writemail .err, .writemail .fbtn { grid-column: 1 / -1; }
.writemail textarea.inp { height: 80px; }
.writemail .fbtn { justify-self: center; }
.writemail label { font-weight: bold; color: #fffc17; }

/* Academy > Enhance */
.scroll.enh { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0; }
.epanel { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 4px 8px 0; background: rgba(40, 36, 30, .45); }
.epanel .subtabs { background: rgba(40, 36, 30, .55); margin: 0; }
.emain { flex: 1; min-height: 0; display: flex; gap: 6px; }
.elist { width: 196px; flex: none; overflow-y: auto; padding: 2px 4px; }
.eitem { display: flex; align-items: center; gap: 4px; height: 26px; font-weight: bold; font-size: 13px; white-space: nowrap; cursor: pointer; }
.eitem input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: #444; }
.eright { flex: 1; min-width: 0; padding: 3px 4px 0 0; display: flex; flex-direction: column; gap: 0; }
.ehead { display: flex; gap: 4px; }
.ehead img.iic { width: 46px; height: 46px; }
.ebox { flex: 1; min-width: 0; background: rgba(30, 30, 30, .5); padding: 2px 4px; font-weight: bold; font-size: 12px; min-height: 48px; }
.esep { height: 1px; background: #ddd; margin: 1px 0; }
.erate { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.erate i { font-size: 12px; }
.earrow { width: 26px; height: 26px; flex: none; background: url(/assets/ui/button/arrow_d.png) center / contain no-repeat; }
.erow { display: flex; align-items: center; gap: 4px; font-weight: bold; font-size: 13px; }
.erow .grow { flex: 1; font-weight: normal; }
.hurry, .boostbtn { width: 24px; height: 24px; border: 0; padding: 0; cursor: pointer; background: url(/assets/ui/button/promote.png) center / 22px 22px no-repeat; flex: none; }
.hurry:disabled { opacity: .35; cursor: default; }

/* building boost popup ("My lord, use these to help our castle thrive") */
.dlg.boost { width: 400px; background: rgba(35, 32, 28, .95); border: 3px solid #8d7a5a; }
.dlg.boost .dlg-title { color: #fff; font-weight: normal; }
.brow { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
.brow img.iic { width: 46px; height: 46px; }
.brow .main { flex: 1; min-width: 0; }
.bname { display: flex; align-items: center; gap: 8px; }
.bname .price { color: #fff; }
.brow .pre.small { font-size: 12px; color: #fff; }

/* My Heroes list (Name, Lvl., Att., Wis., Def., Loy., MaxTroop, Status) */
table.tbl.heroes th, table.tbl.heroes td { text-align: center; border-bottom: 0; }
table.tbl.heroes td.hp { width: 64px; }
table.tbl.heroes .hp img.pt { width: 58px; height: 58px; border: 2px solid #a08a1e; }
table.tbl.heroes .hp img.rk { left: 5px; bottom: 18px; }
table.tbl.heroes .hp b { font-size: 14px; }
[hidden] { display: none !important; }

/* Trade market: category, search box and button in one bar; price and time left in each row */
.tsearch { display: flex; gap: 6px; align-items: center; margin: -4px -8px 4px; }
.tsearch .inp { flex: 1; height: 24px; }
.shead .price.wide { width: auto; min-width: 96px; }
.shead .left { display: inline-flex; align-items: center; gap: 2px; flex: none; color: #fff; font-weight: bold; min-width: 72px; }
.shead .left img { width: 20px; height: 20px; }
/* Hero page: arena record under the portrait, action buttons under the stats */
.hd .arec { margin-top: 4px; background: rgba(48, 36, 24, .6); color: #fff; font-size: 12px; padding: 2px 0; }
.hd .arec b { color: #fffc17; }
.hd .hbtns { display: flex; flex-direction: column; gap: 5px; flex: none; width: 92px; }
.hd .hbtns .fbtn { width: 100%; }
.hd .hbtns .sel { width: 100%; font-size: 11px; }
.unlock { margin-top: 8px; border-top: 1px solid #5a4630; padding-top: 6px; }
.unlock > h4 { margin: 2px 6px; color: #ffd27a; }
.unlock ul.reqs { list-style: none; margin: 3px 0 0; padding: 0; font-size: 12px; }
.unlock ul.reqs li { margin: 1px 0; }

/* incoming-attack warning */
.qline.alert { background: rgba(150, 0, 0, .75); color: #fff; }
.band.alert { background: rgba(140, 20, 20, .85); }
h4.bad { color: #ff6b6b; }
.mwrap { display: flex; align-items: center; gap: 6px; } .mwrap .mrow { flex: 1; min-width: 0; } .pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 8px 0; }

#top button.castle { border: 0; text-align: left; cursor: pointer; }

/* Quietus, the tutorial advisor, and the startup tips */
.advisor { display: flex; gap: 10px; align-items: flex-start; min-height: 80px; }
.advisor-face { width: 96px; height: auto; flex: none; border-radius: 6px; }
.advisor-text p { margin: 0; line-height: 1.45; }
.advisor-text b { color: #ffd84a; }
label.check { display: flex; align-items: center; gap: 6px; margin-top: 10px; cursor: pointer; }
.helpform label { display: block; margin-top: 6px; }
.helpform .inp { width: 100%; box-sizing: border-box; }

/* the gift icon on the city, and its popup */
.giftbtn { position: absolute; z-index: 3; right: 8px; top: 178px; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
.giftbtn .pico { width: 40px; height: 40px; display: block; }
.giftbtn.ready::after { content: ''; position: absolute; right: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: #e33; box-shadow: 0 0 0 2px #fff; }
.giftbox { min-width: 300px; }
.giftrow { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.giftrow p { margin: 2px 0; }
.giftact { margin: 10px 0 2px; text-align: center; }
/* Downtown > Overview */
.blesslist .qrow { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.qline .plus { margin-left: auto; }
.tbl.result th, .tbl.result td { text-align: center; } .tbl.result tr th:first-child { text-align: left; width: 90px; }
.rrow .rtype { width: 64px; flex: none; color: #fc0; } .rrow .good, .rrow .bad { width: 36px; flex: none; text-align: center; }
.flaggrid { display: grid; grid-template-columns: repeat(auto-fill, 30px); gap: 3px; max-height: 200px; overflow-y: auto; } .flagbtn { padding: 2px; background: rgba(0,0,0,.3); border: 1px solid #765; cursor: pointer; }

/* Academy > Fusion */
.fslots { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.fslot { width: 96px; min-height: 96px; background: rgba(0,0,0,.35); border: 1px solid #8a6d3b; border-radius: 6px; color: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.newsline.owner { background: rgba(255, 252, 23, .08); }
.whatsnew { margin: 4px 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
