:root {
  --bg: #0e0a06; --bg2: #1c140c; --panel: #24190f; --panel2: #2e2114; --line: #5a4426;
  --gold: #e0b252; --gold2: #ffe08a; --gold3: #8a6420; --text: #f1ead8; --muted: #a8a294; --dim: #6f6a5f;
  --red: #e0434f; --green: #4cbf6b; --blue: #4f8df7; --purple: #a055e8; --orange: #f0a020;
  --c-common: #9aa3ad; --c-uncommon: #5cb85c; --c-rare: #3d8bfd; --c-epic: #a055e8; --c-legendary: #f0a020;
  --radius: 14px; --hud-h: 98px; --nav-h: 64px;
  --font: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif; --font-head: 'Changa', 'Cairo', sans-serif; --font-logo: 'Jomhuria', 'Lalezar', 'Changa', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.4; overscroll-behavior: none; }
body { background: radial-gradient(ellipse at top, #2a1d10 0%, var(--bg) 60%) fixed; }
button { font-family: inherit; line-height: inherit; }
#app { max-width: 560px; margin: 0 auto; height: 100%; position: relative; overflow: hidden; background: var(--bg); box-shadow: 0 0 60px #0008; }
.boot { height: 100%; display: grid; place-content: center; text-align: center; gap: 8px; }
.boot h1 { font-family: var(--font-head); color: var(--gold2); margin: 0; font-size: 34px; text-shadow: 0 2px 0 #000; }
.boot p { color: var(--muted); margin: 0; }
.boot-crown { width: 84px; height: 84px; margin: 0 auto; background: url(/icon.svg) center/contain no-repeat; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Buttons & inputs ---------- */
.btn { appearance: none; border: 1px solid var(--gold3); background: linear-gradient(#f3cd6e, #c08f2c); color: #2a1a00; font-weight: 800; border-radius: 10px; padding: 9px 14px; font-size: 14px; cursor: pointer; box-shadow: 0 2px 0 #5c400c, inset 0 1px 0 #fff6; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #5c400c; }
.btn[disabled] { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.btn.sec { background: linear-gradient(#5a3f1f, #3a2814); color: var(--text); border-color: #7a5a2e; box-shadow: 0 2px 0 #121838, inset 0 1px 0 #fff2; }
.btn.green { background: linear-gradient(#5fd17f, #2f8f4c); color: #04210d; border-color: #1f6a35; box-shadow: 0 2px 0 #124a24; }
.btn.red { background: linear-gradient(#f06470, #b52a35); color: #fff; border-color: #7a1820; box-shadow: 0 2px 0 #5a1016; }
.btn.purple { background: linear-gradient(#b67af0, #7a3cc0); color: #fff; border-color: #5a2a90; box-shadow: 0 2px 0 #3c1a66; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); box-shadow: none; }
input, select, textarea { font-family: inherit; line-height: 1.4; font-size: 15px; background: #0c1020; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; }
input[type=range] { padding: 0; accent-color: var(--gold); }
label { display: block; color: var(--muted); font-size: 13px; margin: 10px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .gold { color: var(--gold2); } .red { color: var(--red); } .green { color: var(--green); }
.small { font-size: 12px; } .tiny { font-size: 11px; } .center { text-align: center; } .bold { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
h2, h3 { font-family: var(--font-head); color: var(--gold2); margin: 4px 0 8px; font-weight: 700; }
h2 { font-size: 20px; } h3 { font-size: 16px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* ---------- Auth ---------- */
.auth { height: 100%; overflow: auto; padding: 28px 20px 40px; background: linear-gradient(#0e0a06cc, #0e0a06), radial-gradient(circle at 50% 0, #3a2d10, transparent 60%); }
.auth .logo { text-align: center; margin: 14px 0 20px; }
.auth .logo .crown { width: 92px; height: 92px; margin: 0 auto 6px; background: url(/icon.svg) center/contain no-repeat; filter: drop-shadow(0 6px 18px #e0b25244); }
.auth .logo h1 { font-family: var(--font-head); font-size: 38px; margin: 0; color: var(--gold2); text-shadow: 0 3px 0 #000; }
.auth .logo p { margin: 4px 0 0; color: var(--muted); }
.card { background: linear-gradient(var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 6px 20px #0006; }
.card + .card { margin-top: 10px; }
.tabs { display: flex; gap: 4px; background: #0d0906; border-radius: 12px; padding: 4px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1; white-space: nowrap; background: transparent; border: 0; color: var(--muted); padding: 8px 10px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; position: relative; }
.tabs button.on { background: linear-gradient(#5a3f1f, #3a2814); color: var(--gold2); }
.tabs .dot, .navbtn .dot, .badge { position: absolute; top: 2px; left: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; font-weight: 800; }
.code { font-family: ui-monospace, Consolas, monospace; direction: ltr; font-size: 20px; letter-spacing: 1px; background: #000; padding: 12px; border-radius: 10px; text-align: center; color: var(--gold2); border: 1px dashed var(--gold); user-select: all; }
.pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pick > * { border: 2px solid transparent; border-radius: 12px; cursor: pointer; padding: 2px; background: #0d0906; }
.pick > .on { border-color: var(--gold); box-shadow: 0 0 0 2px #e0b25255; }
.swatch { aspect-ratio: 1; border-radius: 9px; }

/* ---------- Game shell ---------- */
.game { height: 100%; display: flex; flex-direction: column; }
.hud { position: relative; z-index: 5; padding: 8px 10px 6px; background: linear-gradient(#1c140c, #0f1528ee); border-bottom: 1px solid #6b4f28; box-shadow: 0 4px 14px #0008; }
.hud-top { display: flex; align-items: center; gap: 8px; }
.avatar { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--gold); overflow: hidden; flex: none; background: #000; cursor: pointer; }
.avatar svg { width: 100%; height: 100%; display: block; }
.hud .who { flex: 1; min-width: 0; line-height: 1.15; }
.hud .who .n { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .who .p { font-size: 12px; color: var(--gold2); display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; }
.hud .who .p svg { width: 14px; height: 14px; flex: none; }
.kv svg, .row > svg, .t svg, .bold svg { width: 18px; height: 18px; vertical-align: middle; }
.btn svg { width: 18px; height: 18px; }
.ic > svg { width: 100%; height: 100%; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #0d0906; border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px 2px 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip svg { width: 16px; height: 16px; flex: none; }
.chip.click { cursor: pointer; }
.chip.warn { border-color: var(--red); color: #ffb3b8; }
.chip.shield { border-color: var(--blue); color: #bcd6ff; }
.res-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 6px; }
.res-row .chip { justify-content: center; padding: 2px 4px; }
.res-row .chip.full { border-color: var(--orange); }
.queue-bar { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; background: #0d0906cc; scrollbar-width: none; position: relative; z-index: 4; min-height: 0; }
.queue-bar:empty { display: none; }
.queue-bar::-webkit-scrollbar { display: none; }
.qchip { flex: none; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 12px; cursor: pointer; position: relative; overflow: hidden; }
.qchip .bar { position: absolute; inset: auto 0 0 0; height: 3px; background: #0006; }
.qchip .bar i { display: block; height: 100%; background: var(--gold); }
.qchip.done { border-color: var(--green); }
.qchip.incoming { border-color: var(--red); background: #3a1018; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #e0434f55; } }
.view { flex: 1; position: relative; overflow: hidden; }
.nav { height: var(--nav-h); display: grid; grid-template-columns: repeat(6, 1fr); background: linear-gradient(#1c140c, #0d0906); border-top: 1px solid #6b4f28; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.navbtn { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; cursor: pointer; position: relative; }
.navbtn svg { width: 26px; height: 26px; }
.navbtn.on { color: var(--gold2); }
.navbtn.on svg { filter: drop-shadow(0 0 6px #e0b25288); }
.navbtn .dot { top: 6px; left: calc(50% - 22px); }

/* ---------- City ---------- */
.city { position: absolute; inset: 0; overflow: auto; scrollbar-width: none; touch-action: pan-x pan-y; }
.city::-webkit-scrollbar { display: none; }
.city svg.scene { display: block; }
.plot { cursor: pointer; }
.plot:hover .art { filter: brightness(1.12); }
.plot .lbl rect { fill: #0d0906e0; stroke: #e0b25288; }
.plot .lbl text { fill: var(--text); font: 700 15px var(--font); }
.plot .lbl .lv { fill: var(--gold2); }
.plot.locked { opacity: .5; }
.plot .bubble { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.plot .busy-ring { animation: spin 3s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.city-fab { position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.fab { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(#3d2a15, #241910); border: 1px solid #7a5a2e; color: var(--gold2); display: grid; place-items: center; cursor: pointer; position: relative; box-shadow: 0 4px 12px #0008; font-size: 10px; font-weight: 800; }
.fab svg { width: 26px; height: 26px; }
.fab .badge { top: -4px; left: -4px; }
.quest-tip { position: absolute; z-index: 3; bottom: 10px; right: 10px; left: 70px; background: linear-gradient(90deg, #2b2410f2, #241910f2); border: 1px solid var(--gold3); border-radius: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; box-shadow: 0 6px 16px #000a; }
.quest-tip .t { flex: 1; font-size: 13px; font-weight: 700; }
.quest-tip.done { border-color: var(--green); }
.fx { position: absolute; pointer-events: none; z-index: 20; font-weight: 800; color: var(--gold2); text-shadow: 0 2px 0 #000; animation: rise 1.2s ease-out forwards; }
@keyframes rise { to { transform: translateY(-50px); opacity: 0; } }
.sparkle { position: absolute; pointer-events: none; z-index: 20; width: 8px; height: 8px; border-radius: 50%; background: var(--gold2); box-shadow: 0 0 10px var(--gold); animation: spark .9s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ---------- World ---------- */
.world { position: absolute; inset: 0; touch-action: none; background: #0a0e1a; }
.world canvas { display: block; width: 100%; height: 100%; }
.world .coords { position: absolute; top: 8px; right: 8px; z-index: 2; }
.world .wbtns { position: absolute; bottom: 12px; left: 10px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.world .legend { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; max-width: 60%; }

/* ---------- Sheets (bottom panels) ---------- */
#sheets { position: fixed; inset: 0; pointer-events: none; z-index: 50; display: flex; justify-content: center; }
.sheet-wrap { position: absolute; inset: 0; max-width: 560px; margin: 0 auto; pointer-events: auto; display: flex; flex-direction: column; justify-content: flex-end; background: #0008; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: linear-gradient(#22180e, #120c07); border-top: 2px solid var(--gold3); border-radius: 18px 18px 0 0; max-height: 92%; display: flex; flex-direction: column; animation: up .22s cubic-bezier(.2, .9, .3, 1.1); box-shadow: 0 -10px 30px #000a; }
.sheet.full { height: 92%; }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; border-bottom: 1px solid #4a3720; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 19px; }
.sheet-head .x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #0d0906; color: var(--text); font-size: 18px; cursor: pointer; }
.sheet-head .back { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #0d0906; color: var(--text); cursor: pointer; }
.sheet-body { overflow: auto; padding: 12px 14px 22px; overscroll-behavior: contain; }

/* ---------- Lists & items ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 10px; align-items: center; background: #160f09; border: 1px solid #4a3720; border-radius: 12px; padding: 9px 10px; }
.item.click { cursor: pointer; }
.item.click:hover { border-color: #7a5a2e; }
.item .ic { width: 46px; height: 46px; flex: none; border-radius: 10px; background: #0d0906; display: grid; place-items: center; overflow: hidden; border: 1px solid #4a3720; position: relative; }
.item .ic svg { width: 100%; height: 100%; }
.item .ic .q { position: absolute; bottom: 0; left: 0; right: 0; font-size: 10px; background: #000a; text-align: center; font-weight: 800; }
.item .t { font-weight: 800; }
.item .d { font-size: 12px; color: var(--muted); }
.item.locked { opacity: .55; }
.item.unread { border-right: 3px solid var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { background: #0d0906; border: 1px solid #4a3720; border-radius: 10px; padding: 8px; text-align: center; }
.stat .v { font-weight: 800; font-size: 16px; color: var(--gold2); }
.stat .k { font-size: 11px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #4a3720; font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.cost { display: flex; flex-wrap: wrap; gap: 6px; }
.cost .chip.lack { border-color: var(--red); color: #ffb3b8; }
.req { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; }
.req.ok::before { content: '✔'; color: var(--green); }
.req.no::before { content: '✖'; color: var(--red); }
.progress { height: 10px; background: #0d0906; border-radius: 6px; overflow: hidden; border: 1px solid #4a3720; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold3), var(--gold2)); transition: width .4s; }
.progress.green i { background: linear-gradient(90deg, #2f8f4c, #5fd17f); }
.progress.red i { background: linear-gradient(90deg, #8a1e28, #f06470); }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #0d0906; border: 1px solid var(--line); font-weight: 700; }
.r-common { color: var(--c-common); border-color: var(--c-common); } .r-uncommon { color: var(--c-uncommon); border-color: var(--c-uncommon); }
.r-rare { color: var(--c-rare); border-color: var(--c-rare); } .r-epic { color: var(--c-epic); border-color: var(--c-epic); } .r-legendary { color: var(--c-legendary); border-color: var(--c-legendary); }
.stars { color: var(--gold2); letter-spacing: -1px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.notice { background: #2a2410; border: 1px solid var(--gold3); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.notice.red { background: #3a1018; border-color: var(--red); }
.notice.blue { background: #10223a; border-color: var(--blue); }

/* heroes */
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-card { background: #160f09; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; }
.hero-card .portrait { aspect-ratio: 3/4; }
.hero-card .portrait svg { width: 100%; height: 100%; display: block; }
.hero-card .nm { font-size: 12px; font-weight: 800; padding: 4px 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .lv { font-size: 11px; padding: 0 6px 6px; color: var(--muted); }
.hero-card.locked { filter: grayscale(1) brightness(.5); }
.hero-card .tag { position: absolute; top: 4px; right: 4px; }
.skill { background: #0d0906; border: 1px solid #4a3720; border-radius: 10px; padding: 8px; }
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.slot { aspect-ratio: 1; background: #0d0906; border: 2px dashed #4a3720; border-radius: 10px; display: grid; place-items: center; cursor: pointer; font-size: 10px; color: var(--muted); text-align: center; overflow: hidden; }
.slot.filled { border-style: solid; }
.slot svg { width: 80%; height: 80%; }

/* vault */
.vault-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px; background: radial-gradient(circle at 50% 100%, #3a2a12, #0b0a08 70%); border-radius: 14px; border: 1px solid #5a4422; }
.room { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; position: relative; cursor: default; background: #050403; border: 1px solid #2a2014; overflow: hidden; }
.room.adj { background: #1a130a; border-color: #8a6420; cursor: pointer; box-shadow: inset 0 0 14px #e0b25233; }
.room.adj::after { content: '؟'; color: #e0b25288; font-size: 22px; font-weight: 800; }
.room.explored { background: linear-gradient(#3a2c18, #241a0e); border-color: #6b4f28; }
.room.blocked { background: linear-gradient(#4a1a1a, #2a0e0e); border-color: var(--red); cursor: pointer; animation: pulse 1.6s infinite; }
.room svg { width: 70%; height: 70%; }
.room .hpb { position: absolute; bottom: 3px; left: 4px; right: 4px; height: 4px; background: #000; border-radius: 3px; overflow: hidden; }
.room .hpb i { display: block; height: 100%; background: var(--red); }
.torches { display: flex; align-items: center; gap: 8px; }

/* reports */
.rep-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rep-side { background: #0d0906; border: 1px solid #4a3720; border-radius: 10px; padding: 8px; font-size: 12px; }
.rep-side.win { border-color: var(--green); }
.rep-side.lose { border-color: var(--red); }
.rep-side table { width: 100%; border-collapse: collapse; }
.rep-side td { padding: 2px 0; }
.banner-res { text-align: center; font-family: var(--font-head); font-size: 26px; padding: 8px; border-radius: 12px; margin-bottom: 8px; }
.banner-res.win { background: linear-gradient(#2f8f4c55, transparent); color: #8ff0aa; }
.banner-res.lose { background: linear-gradient(#b52a3555, transparent); color: #ffb3b8; }
.rounds { display: flex; gap: 2px; align-items: flex-end; height: 50px; }
.rounds div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; }
.rounds i { display: block; border-radius: 2px 2px 0 0; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; padding: 4px; }
.msg { background: #160f09; border-radius: 10px; padding: 6px 9px; font-size: 13px; }
.msg .who { color: var(--gold2); font-weight: 800; font-size: 12px; }
.msg.mine { background: #3a2814; }

/* toasts */
#toasts { position: fixed; top: 110px; left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: #0d0906f2; border: 1px solid var(--gold3); color: var(--text); padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 18px #000a; animation: toast 3.2s forwards; max-width: 90%; text-align: center; }
.toast.err { border-color: var(--red); color: #ffd0d4; }
.toast.ok { border-color: var(--green); }
@keyframes toast { 0% { transform: translateY(-10px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
.reveal { text-align: center; padding: 20px; animation: revealIn .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes revealIn { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.glow-legendary { filter: drop-shadow(0 0 18px #f0a020); }
.glow-epic { filter: drop-shadow(0 0 14px #a055e8); }

@media (min-width: 561px) { #app { border-left: 1px solid #3a2a16; border-right: 1px solid #3a2a16; } }

/* connection banner, gifts, accessibility, LTR */
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: #8a1e28; color: #fff; text-align: center; padding: 8px 12px; font-weight: 700; font-size: 13px; display: flex; gap: 8px; justify-content: center; align-items: center; box-shadow: 0 4px 12px #000a; }
.netbar .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff6; border-top-color: #fff; animation: spin 0.8s linear infinite; }
.chip.gift { border-color: var(--gold); animation: pulse 1.6s infinite; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
[dir=ltr] .item.unread { border-right: 1px solid #4a3720; border-left: 3px solid var(--gold); }
[dir=ltr] .tabs .dot, [dir=ltr] .badge { left: auto; right: 4px; }
[dir=ltr] .quest-tip { left: 10px; right: 70px; }
[dir=ltr] .city-fab { left: auto !important; right: 10px; }
.hud-chips { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.hud-chips:empty { display: none; }
.hud-chips .chip { font-size: 11px; padding: 1px 7px 1px 5px; }
.hud-chips .chip svg { width: 14px; height: 14px; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.reward-grid .cost { justify-content: center; }
.grid2 > *, .grid3 > *, .grid4 > * { min-width: 0; }

/* ---------- 3D city ---------- */
.city3d { position: absolute; inset: 0; overflow: hidden; background: #e9dcc0; }
.c3-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; }
.c3-canvas:active { cursor: grabbing; }
.c3-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.c3-lbl { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 4px; white-space: nowrap; will-change: transform;
  font-size: 11.5px; font-weight: 700; color: #fff7e6; padding: 2px 8px 2px 3px; border-radius: 999px;
  background: linear-gradient(#2a1d10e6, #0d0906e6); border: 1px solid #e0b25299; box-shadow: 0 2px 6px #0006; text-shadow: 0 1px 2px #000; }
.c3-lbl .lv { min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 4px; font-size: 11px; font-weight: 900;
  color: #2a1c05; background: linear-gradient(#ffe7a0, #c8952f); text-shadow: none; }
.c3-lbl .lk { width: 18px; text-align: center; font-size: 11px; }
.c3-lbl .tm { color: #ffe08a; font-variant-numeric: tabular-nums; padding-inline-start: 4px; border-inline-start: 1px solid #e0b25266; }
.c3-lbl.small { font-size: 10.5px; opacity: .92; }
.c3-lbl.locked { opacity: .62; border-color: #8886; }
.c3-overlay.mid .c3-lbl.small .nm { display: none; }
.c3-overlay.far .c3-lbl .nm { display: none; }
.c3-overlay.far .c3-lbl { padding-inline-end: 3px; }
.c3-bubble { position: absolute; left: 0; top: 0; pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(#3a2814, #0d0906); border: 2px solid #e0b252; box-shadow: 0 3px 10px #0008; animation: c3bob 1.6s ease-in-out infinite; padding: 0; }
.c3-bubble.full { border-color: #e0434f; }
@keyframes c3bob { 50% { margin-top: -6px; } }
/* pre-rendered art in lists */
.art-img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 3px #0008); }
.ic .unit-art, .stat .unit-art { transform: scale(1.25); }
.monster-art { height: 170px; margin: 4px 0 10px; border-radius: 14px; background: radial-gradient(ellipse at 50% 70%, #d8c39b 0%, #a88b5e 60%, #5e4a30 100%); padding: 8px; }
.world canvas { touch-action: none; }
.c2-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; }
.c2-glow { position: absolute; pointer-events: none; background-size: 100% 100%; opacity: 0; filter: brightness(1.6) drop-shadow(0 0 10px #ffd36b); }
.c2-glow.on { animation: c2glow .55s ease-out; }
@keyframes c2glow { 0% { opacity: .85; transform: scale(1.03); } 100% { opacity: 0; transform: scale(1); } }
.c2-loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: 999px; background: #0d0906d9; color: #ffe08a; font-weight: 700; border: 1px solid #e0b25288; pointer-events: none; opacity: 0; transition: opacity .3s; }
.c2-loading.on { opacity: 1; }
.unit-tier { height: 64px; margin: -4px -4px 2px; }
.unit-tier .unit-art { transform: none; }
.unit-hero { width: 120px; height: 140px; flex: none; border-radius: 14px; padding: 4px; background: radial-gradient(ellipse at 50% 75%, #d8c39b 0%, #a88b5e 55%, #3e3222 100%); border: 1px solid #e0b25266; }
.unit-hero .unit-art { transform: scale(1.15); transform-origin: 50% 60%; }
.world .track-chip { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(10,14,28,.85); border: 1px solid var(--gold, #e0b252); color: #ffe08a; font-size: 13px; font-weight: 700; cursor: pointer; }
.world .track-chip svg { width: 18px; height: 18px; }
.world .track-chip b { color: #fff; opacity: .7; }
.btn.sm svg { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 3px; }
.look-next { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(90deg, rgba(224,178,82,.16), rgba(224,178,82,.04)); border: 1px dashed rgba(224,178,82,.55); }
.look-next.done { justify-content: center; color: #ffe08a; font-weight: 700; font-size: 13px; }
.look-next .look-img { width: 74px; height: 66px; flex: none; }
.look-next .look-img img { width: 100%; height: 100%; object-fit: contain; }
.hero-art { position: relative; width: 100%; height: 100%; aspect-ratio: 360/468; overflow: hidden; border-radius: inherit;
  background: radial-gradient(120% 80% at 50% 28%, color-mix(in srgb, var(--hb) 55%, #fff 0%) 0%, var(--ha) 45%, color-mix(in srgb, var(--ha) 35%, #000) 100%); }
.hero-art::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 -18px 24px -10px color-mix(in srgb, var(--hr) 55%, transparent), inset 0 0 0 1px rgba(255,255,255,.06); pointer-events: none; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.item .ic .hero-art { aspect-ratio: auto; }
.item .ic .hero-art img { object-position: 50% 22%; transform: scale(1.35); transform-origin: 50% 25%; }

/* =====================================================================
   Royal skin: carved dark wood, gold trim, rendered 3D icons (tools/art/ui.py)
   ===================================================================== */
:root { --bg: #0e0a06; --bg2: #1a120b; --panel: #24190f; --panel2: #2e2114; --line: #5a4426; --gold3: #8a6420;
  --carved: url(/art/ui/carved.webp); --ring: url(/art/ui/ring.webp); --plaque: url(/art/ui/plaque.webp);
  --trim: linear-gradient(90deg, #3a2608, #c08f2c 12%, #ffe9a8 30%, #b8862a 50%, #ffe9a8 70%, #c08f2c 88%, #3a2608); }
body { background: #070504; }
#app { background: #0e0a06; }
svg.ic3d { overflow: visible; filter: drop-shadow(0 1.5px 1.5px #000b); }

/* buttons */
.btn { background: linear-gradient(#fff0b8 0%, #f0c560 22%, #c8902c 52%, #a8701c 56%, #e0b04a 100%); border: 1px solid #4a3008; color: #2a1600;
  border-radius: 8px; box-shadow: 0 2px 0 #2a1a04, inset 0 0 0 1px #ffe9a888, 0 3px 8px #0008; text-shadow: 0 1px 0 #fff6; }
.btn.sec { background: linear-gradient(#5a4026, #3a2614 50%, #2a1a0c 52%, #3a2816); color: #ffe7b0; border-color: #a87a2c; box-shadow: 0 2px 0 #0a0604, inset 0 0 0 1px #e0b25233, 0 3px 8px #0008; text-shadow: 0 1px 1px #000; }
.btn.red { background: linear-gradient(#d8423c, #8c1712 50%, #6e0e0a 52%, #a0201a); color: #fff1d0; border-color: #e0b252; box-shadow: 0 2px 0 #2a0604, inset 0 0 0 1px #ffd36b55, 0 3px 8px #0008; text-shadow: 0 1px 1px #000; }
.btn.green { background: linear-gradient(#7ad35a, #2f8a2a 50%, #226e1e 52%, #3c9a32); color: #fff; border-color: #e0b252; text-shadow: 0 1px 1px #000; box-shadow: 0 2px 0 #0a2a06, inset 0 0 0 1px #ffd36b55; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); box-shadow: none; text-shadow: none; }
input, select, textarea { background: #0b0805; border-color: #4a3720; }

/* top bar */
.hud { padding: 6px 8px 7px; background: linear-gradient(#0008, #000c), var(--carved) center / auto 100%, #120c07; border-bottom: 0; box-shadow: 0 6px 16px #000c; }
.hud::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--trim); box-shadow: 0 1px 3px #000; }
.hud-main { display: flex; gap: 6px; align-items: center; }
.hud-av { position: relative; width: 62px; height: 62px; flex: none; cursor: pointer; padding: 0; border: 0; background: none; }
.hud-av .av-img { position: absolute; inset: 7px; border-radius: 50%; overflow: hidden; background: #000; }
.hud-av .av-img svg { width: 100%; height: 100%; display: block; }
.hud-av::after { content: ''; position: absolute; inset: -1px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.hud-av .av-lv { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); z-index: 1; min-width: 24px; height: 18px; line-height: 17px; padding: 0 5px; border-radius: 9px;
  font-size: 11px; font-weight: 900; color: #fff3cf; background: linear-gradient(#5a1a12, #2a0a06); border: 1px solid #e0b252; box-shadow: 0 2px 4px #000; }
.hud-mid { flex: 1; min-width: 0; }
.hud .res-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 0; }
.hud .res { display: flex; align-items: center; justify-content: center; gap: 1px; padding: 0; border: 0; background: none; cursor: pointer;
  font-weight: 800; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; min-width: 0; }
.hud .res svg { width: 25px; height: 25px; flex: none; }
.hud .res.full .num { color: #ffb35a; }
.hud-line { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.hud .vip { flex: none; font-family: var(--font-head); font-weight: 900; font-size: 12px; color: #ffe08a; background: linear-gradient(#6a2a12, #2a0e06); border: 1px solid #c08f2c; border-radius: 5px;
  padding: 1px 7px; text-shadow: 0 1px 0 #000; cursor: pointer; box-shadow: inset 0 1px 0 #ffd36b44; direction: ltr; }
.hud .power { flex: 1; min-width: 0; height: 24px; display: flex; align-items: center; justify-content: center; gap: 3px; background: url(/art/ui/ribbon.webp) center / 100% 100% no-repeat;
  color: #fff; font-weight: 900; font-size: 13.5px; text-shadow: 0 1px 2px #000; padding: 0 14px; }
.hud .power svg { width: 18px; height: 18px; }
.hud-ic { position: relative; flex: none; width: 28px; height: 28px; padding: 2px; border-radius: 50%; border: 1px solid #a87a2c; background: radial-gradient(#3a2814, #0d0906); cursor: pointer; display: grid; place-items: center; }
.hud-ic svg { width: 22px; height: 22px; }
.hud-ic .dot { position: absolute; top: -5px; left: -5px; min-width: 15px; height: 15px; line-height: 15px; border-radius: 8px; background: #d22; color: #fff; font-size: 9.5px; font-weight: 800; padding: 0 3px; border: 1px solid #ffd36b; }
.hud-ic.gift { animation: pulse 1.6s infinite; }
.hud-ic.warn { border-color: #f33; animation: pulse 1s infinite; }
.hud-ic.shield { width: auto; border-radius: 14px; display: flex; gap: 2px; padding: 2px 6px 2px 3px; border-color: #5a8af0; }
.hud-ic.shield .tm { font-size: 10.5px; font-weight: 800; color: #cfe0ff; }
.hud-gems { position: relative; flex: none; width: 54px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: linear-gradient(#3a6a1a, #15400a 55%, #0e2e06); border: 1px solid #e0b252; border-radius: 10px; color: #ffe08a; font-weight: 900; font-size: 12px; text-shadow: 0 1px 1px #000;
  box-shadow: inset 0 1px 0 #fff4, inset 0 0 0 2px #0006, 0 3px 8px #000a; }
.hud-gems svg { width: 30px; height: 30px; margin: -4px 0 -2px; }

/* queue bar */
.queue-bar { background: linear-gradient(#1a120bee, #0e0a06ee); border-bottom: 1px solid #3a2a16; }
.qchip { background: linear-gradient(#2e2114, #1a120b); border-color: #6b4f28; }

/* bottom navigation */
.nav { height: 72px; background: linear-gradient(#000a, #000d), var(--carved) center / auto 100%, #120c07; border-top: 0; position: relative; overflow: visible; }
.nav::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 3px; background: var(--trim); box-shadow: 0 -1px 3px #000; }
.navbtn { color: #d8c39b; text-shadow: 0 1px 2px #000; gap: 0; font-size: 11px; }
.navbtn .sock { position: relative; width: 46px; height: 46px; display: grid; place-items: center; transition: transform .18s; }
.navbtn .sock svg { width: 38px; height: 38px; }
.navbtn .sock::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(#3a2814 0%, #0d090600 70%); }
.navbtn.on { color: #ffe08a; }
.navbtn.on .sock { transform: translateY(-9px) scale(1.12); }
.navbtn.on .sock::before { inset: 1px; background: radial-gradient(#6a4a1e, #1a0f06 75%); box-shadow: 0 4px 10px #000c; }
.navbtn.on .sock::after { content: ''; position: absolute; inset: -4px; background: var(--ring) center / contain no-repeat; }
.navbtn.on svg { filter: drop-shadow(0 0 6px #ffcf6b88); }
.navbtn .lb { margin-top: -2px; }
.navbtn.on .lb { margin-top: -10px; font-weight: 900; }
.navbtn .dot { top: 2px; left: calc(50% - 26px); z-index: 2; border: 1px solid #ffd36b; }

/* round side buttons (city) */
.fab { width: 54px; height: 54px; border-radius: 50%; border: 0; background: radial-gradient(#4a3218 0%, #1a1008 70%); box-shadow: 0 4px 10px #000a;
  color: #ffe9b8; font-size: 10px; font-weight: 900; text-shadow: 0 1px 2px #000, 0 0 3px #000; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.fab::after { content: ''; position: absolute; inset: -3px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.fab svg { width: 34px; height: 34px; }
.fab .badge { top: -6px; left: -4px; z-index: 2; border: 1px solid #ffd36b; }
.city-fab { gap: 10px; }
.quest-tip { background: linear-gradient(90deg, #2a1a0cf2, #120c07f2); border: 1px solid #a87a2c; border-radius: 10px; box-shadow: 0 6px 16px #000a, inset 0 1px 0 #ffd36b33; }

/* sheets, cards, lists */
.sheet-wrap { background: #000a; }
.sheet { background: linear-gradient(#1a120bf4, #0e0a06f8), var(--carved) center top / 640px auto, #0e0a06; border-top: 0; border-radius: 14px 14px 0 0; position: relative; }
.sheet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 14px 14px 0 0; background: var(--trim); }
.sheet-head { border-bottom: 1px solid #5a4426; background: linear-gradient(#3a2614, #1a110a); border-radius: 14px 14px 0 0; padding-top: 14px; box-shadow: 0 2px 6px #0008; }
.sheet-head h2 { text-align: center; color: #ffe08a; text-shadow: 0 2px 0 #000, 0 0 10px #c08f2c55; }
.sheet-head h2::before, .sheet-head h2::after { content: '❖'; font-size: 11px; color: #c08f2c; margin: 0 8px; vertical-align: 3px; }
.sheet-head .x, .sheet-head .back { border-radius: 50%; border: 1px solid #c08f2c; background: radial-gradient(#5a1a12, #2a0a06); color: #ffe08a; font-weight: 900; }
.card { background: linear-gradient(#2a1d10e6, #140d07f0); border: 1px solid #5a4426; border-radius: 10px; box-shadow: inset 0 1px 0 #ffd36b22, 0 4px 14px #0008; }
.item { background: linear-gradient(90deg, #22170d, #150e08); border: 1px solid #4a3720; border-radius: 10px; box-shadow: inset 0 1px 0 #ffd36b14; }
.item.click:hover { border-color: #a87a2c; }
.item .ic { background: radial-gradient(#3a2814, #0d0906); border-color: #6b4f28; }
.stat, .skill, .rep-side, .slot, .pill, .chip { background: #120c07; border-color: #4a3720; }
.tabs { background: #0b0805; border: 1px solid #3a2a16; }
.tabs button.on { background: linear-gradient(#6a4a1e, #3a2614); color: #ffe08a; box-shadow: inset 0 0 0 1px #c08f2c88; }
.progress { background: #0b0805; border-color: #4a3720; }
h2, h3 { text-shadow: 0 1px 0 #000; }
.toast { background: linear-gradient(#2a1d10f4, #120c07f4); border-color: #c08f2c; }

/* city labels: level plaques (names appear only on the selected building) */
.c3-lbl { background: none; border: 0; box-shadow: none; padding: 0; gap: 3px; flex-direction: column; align-items: center; }
.c3-lbl .lv { width: 30px; height: 30px; line-height: 25px; border-radius: 0; padding: 0; background: var(--plaque) center / contain no-repeat; color: #ffe08a; font-size: 12.5px; font-weight: 900;
  text-shadow: 0 1px 1px #000, 0 0 3px #000; filter: drop-shadow(0 2px 2px #000a); order: 2; }
.c3-lbl .lk { width: 24px; height: 24px; line-height: 22px; border-radius: 50%; background: radial-gradient(#3a2814, #0d0906); border: 1px solid #a87a2c; color: #ffe08a; font-size: 11px; order: 2; }
.c3-lbl .nm { display: none; order: 1; font-family: var(--font-head); font-size: 13px; color: #ffe9b8; padding: 2px 12px; border-radius: 4px; background: linear-gradient(#3a2614f0, #1a110af0);
  border: 1px solid #c08f2c; box-shadow: 0 2px 6px #000a; white-space: nowrap; }
.c3-lbl .tm { order: 3; border: 1px solid #c08f2c; border-radius: 9px; padding: 0 6px; background: #0d0906e6; font-size: 10.5px; color: #8ff0aa; }
.c3-lbl.sel .nm, .c3-lbl.sel.small .nm { display: block !important; }
.c3-overlay.far .c3-lbl .lv { width: 24px; height: 24px; line-height: 20px; font-size: 10.5px; }
.c3-lbl.locked { opacity: .75; }
.c3-bubble { background: radial-gradient(#4a3218, #1a1008); border: 0; width: 46px; height: 46px; }
.c3-bubble::after { content: ''; position: absolute; inset: -3px; background: var(--ring) center / contain no-repeat; }
.c3-bubble svg { width: 30px !important; height: 30px !important; }
/* radial action ring around the selected building */
.c2-radial { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.c2-radial .rb { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 0; padding: 0; pointer-events: auto; cursor: pointer;
  background: radial-gradient(#4a3218 0%, #1a1008 72%); box-shadow: 0 4px 10px #000b; display: grid; place-items: center; animation: rbIn .22s cubic-bezier(.2, 1.4, .4, 1) both; }
.c2-radial .rb::after { content: ''; position: absolute; inset: -3px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.c2-radial .rb svg { width: 36px; height: 36px; }
.c2-radial .rb span { position: absolute; top: 100%; margin-top: 1px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 900; color: #fff3cf;
  text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 2px #000; }
.c2-radial .rb.hot::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; box-shadow: 0 0 14px 4px #ffcf6b88; animation: pulse 1.4s infinite; }
@keyframes rbIn { from { transform: scale(.2); opacity: 0; } }

/* upgrade screen */
.upg-hero { position: relative; height: 210px; margin: -12px -14px 0; background: radial-gradient(ellipse at 50% 85%, #6a5232 0%, #2a1d10 55%, #0e0a06 100%); overflow: hidden; border-bottom: 1px solid #5a4426; }
.upg-hero .art-img { width: 100%; height: 100%; object-fit: contain; padding: 8px 0 0; filter: drop-shadow(0 10px 14px #000c); }
.upg-hero .upg-lv { position: absolute; top: 10px; right: 12px; text-align: center; }
.upg-hero .upg-lv b { display: block; font-family: var(--font-head); color: #ffe08a; font-size: 19px; text-shadow: 0 2px 0 #000; }
.upg-hero .upg-lv i { font-style: normal; font-size: 12px; color: #e8d6b0; }
.upg-next { position: absolute; top: 10px; left: 10px; width: 46%; max-height: 190px; overflow: auto; padding: 8px 10px 10px; border-radius: 0 0 10px 10px; scrollbar-width: none;
  background: linear-gradient(#10224aee, #0a1430ee); border: 1px solid #c08f2c; border-top: 3px solid #c08f2c; box-shadow: 0 6px 14px #000a; font-size: 12px; }
.upg-next .h { display: flex; justify-content: space-between; color: #ffe08a; font-weight: 900; margin-bottom: 4px; }
.upg-next .kv { padding: 2px 0; font-size: 11.5px; border-bottom-color: #ffffff1a; }
.upg-sec { text-align: center; color: #ffe08a; font-family: var(--font-head); margin: 10px 0 6px; font-size: 15px; }
.upg-sec::before, .upg-sec::after { content: ''; display: inline-block; width: 60px; height: 1px; background: linear-gradient(90deg, transparent, #c08f2c); vertical-align: middle; margin: 0 8px; }
.upg-sec::after { transform: scaleX(-1); }
.reqrow { display: grid; grid-template-columns: 30px 1fr 18px auto; align-items: center; gap: 8px; padding: 5px 8px; margin-bottom: 4px; border-radius: 6px; background: linear-gradient(90deg, #22170d, #120c07); border: 1px solid #3a2a16; font-size: 13px; font-weight: 700; }
.reqrow svg { width: 28px; height: 28px; }
.reqrow .ok { color: #5fd17f; font-weight: 900; } .reqrow .no { color: #f05050; font-weight: 900; }
.reqrow .t.no { color: #ff7a6a; } .reqrow .t.ok { color: #e8e0c8; }
.reqrow .btn { min-height: 28px; padding: 3px 10px; font-size: 12px; min-width: 104px; }
.upg-time { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 900; font-size: 15px; margin: 10px 0 6px; color: #fff; }
.upg-time svg { width: 26px; height: 26px; }
.upg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upg-btns .btn { min-height: 50px; font-size: 15px; flex-direction: column; gap: 0; line-height: 1.15; }
.upg-btns .btn small { font-size: 12px; display: flex; align-items: center; gap: 3px; }
.upg-btns .btn small svg { width: 18px; height: 18px; }

/* world: marches panel */
.march-dock { position: absolute; top: 46px; right: 6px; z-index: 3; width: min(260px, 72%); display: flex; flex-direction: column; gap: 4px; }
.march-dock .md-row { display: flex; align-items: stretch; gap: 4px; }
.march-dock .md-card { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; cursor: pointer; overflow: hidden;
  background: linear-gradient(90deg, #0d0906ee, #2a1d10ee); border: 1px solid #8a6420; box-shadow: 0 3px 8px #0009; color: #fff; }
.march-dock .md-card .bar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #2f8a2a99, #2f8a2a33); pointer-events: none; }
.march-dock .md-card.ret .bar { background: linear-gradient(90deg, #4f8df799, #4f8df733); }
.march-dock .md-card.hostile .bar { background: linear-gradient(90deg, #d8423c99, #d8423c33); }
.march-dock .md-card > * { position: relative; }
.march-dock .md-card svg { width: 22px; height: 22px; flex: none; }
.march-dock .md-t { flex: 1; min-width: 0; line-height: 1.1; }
.march-dock .md-t b { display: block; font-size: 12px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.march-dock .md-t i { font-style: normal; font-size: 12px; font-weight: 900; color: #ffe08a; }
.march-dock .md-n { font-size: 10px; color: #d8c39b; }
.march-dock .md-b { flex: none; width: 40px; border-radius: 6px; border: 1px solid #c08f2c; cursor: pointer; display: grid; place-items: center; padding: 0;
  background: linear-gradient(#8a5a1c, #4a2c0a); box-shadow: inset 0 1px 0 #ffd36b55, 0 2px 6px #0008; }
.march-dock .md-b svg { width: 24px; height: 24px; }
.march-dock .md-b.recall { background: linear-gradient(#7a1a14, #3a0806); }
.march-dock .md-toggle { align-self: flex-end; border: 1px solid #8a6420; background: #0d0906dd; color: #ffe08a; border-radius: 6px; font-size: 12px; font-weight: 800; padding: 2px 10px; cursor: pointer; }
.haste-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #3a2a16; }
.haste-row .ic { width: 50px; height: 50px; flex: none; border-radius: 8px; background: radial-gradient(#3a2814, #0d0906); border: 1px solid #8a6420; display: grid; place-items: center; }
.haste-row .ic svg { width: 40px; height: 40px; }
.haste-bar { height: 22px; border-radius: 4px; border: 1px solid #c08f2c; background: #000; position: relative; overflow: hidden; margin: 4px 0 10px; }
.haste-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#5a9af0, #1a4ab0); }
.haste-bar b { position: relative; display: block; text-align: center; line-height: 20px; color: #fff; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.world .track-chip { top: auto; bottom: 16px; }
.c2-canvas { filter: saturate(1.25) contrast(1.08); }
.hud-main { align-items: center; }
.hud .res-row { gap: 0; }
.hud .res { gap: 0; font-size: 12.5px; }
.hud .res svg { width: 24px; height: 24px; margin-inline-end: -1px; }
.hud .hud-gems { width: auto; height: 24px; flex-direction: row; gap: 1px; padding: 0 5px 0 3px; border-radius: 12px; font-size: 12px; }
.hud .hud-gems svg { width: 22px; height: 22px; margin: 0; }
.hud .hud-gems b { width: 14px; height: 14px; line-height: 13px; border-radius: 50%; background: #ffe08a; color: #1a4a0a; font-size: 12px; text-shadow: none; margin-inline-start: 2px; }
.fab .fl { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 10.5px; padding: 0 6px; border-radius: 6px; background: #1a110ae6; border: 1px solid #a87a2c; white-space: nowrap; }
.wbtns .fab { font-size: 9.5px; }
.wbtns .fab { font-size: 22px; } .wbtns .fab .fl { font-size: 10px; }
.hud .res { gap: 2px; font-size: 12px; letter-spacing: -0.2px; } .hud .res svg { width: 22px; height: 22px; margin: 0; }
.upg-next { width: 56%; }
.upg-next .kv { gap: 4px; }
.upg-next .kv .k { flex: 1; min-width: 0; }
.upg-next .kv > span:last-child { white-space: nowrap; }
.reqrow .req-art { display: block; width: 34px; height: 30px; }
.reqrow .req-art img { width: 100%; height: 100%; object-fit: contain; }
.reqrow { grid-template-columns: 34px 1fr 16px auto; }
.world .place-bar { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 4; padding: 10px; border-radius: 12px; background: linear-gradient(#2a1d10f2, #120c07f2); border: 1px solid #c08f2c; box-shadow: 0 6px 18px #000c; }
.world .place-bar .pb-t { text-align: center; font-weight: 900; color: #8ff0aa; margin-bottom: 8px; }
.world .place-bar.bad .pb-t { color: #ff7a6a; }
.unit-show { object-fit: cover !important; object-position: 50% 26%; transform: scale(1.5); transform-origin: 50% 22%; filter: none; }
.ic .unit-show, .stat .unit-show { transform: scale(1.7); }
.unit-tier .unit-show { transform: scale(1.35); }
.unit-showcase { width: 100%; height: 100%; object-fit: contain; display: block; }
/* training screen */
.tr-stage { position: relative; height: 330px; margin: 0 -14px; overflow: hidden;
  background: radial-gradient(ellipse at 45% 88%, #5a4630 0%, #2a1d10 40%, #0e0a06 75%); border-top: 1px solid #3a2a16; border-bottom: 1px solid #5a4426; }
.tr-art { position: absolute; left: 12%; right: 28%; top: 6px; bottom: 0; }
.tr-art img { filter: drop-shadow(0 10px 18px #000c); }
.tr-stats { position: absolute; top: 10px; left: 10px; width: 46%; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.tr-stat { display: grid; grid-template-columns: 42px 1fr 30px; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: #e8d6b0; text-shadow: 0 1px 2px #000; }
.tr-bar { height: 7px; border-radius: 4px; background: #0008; border: 1px solid #5a4426; overflow: hidden; }
.tr-bar i { display: block; height: 100%; }
.tr-mini { display: flex; gap: 8px; font-size: 10.5px; color: #c8b48a; text-shadow: 0 1px 2px #000; }
.tr-tiers { position: absolute; top: 8px; right: 6px; bottom: 34px; width: 76px; display: flex; flex-direction: column; gap: 4px; justify-content: center; z-index: 1; }
.tr-tier { position: relative; height: 52px; border: 0; padding: 0; cursor: pointer; background: none; display: flex; flex-direction: column; align-items: center; }
.tr-tier .tr-ic { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: radial-gradient(#3a2814, #0d0906); box-shadow: 0 0 0 2px #6b4f28, 0 3px 6px #000a; display: block; }
.tr-tier.on .tr-ic { box-shadow: 0 0 0 2px #ffe08a, 0 0 12px #ffcf6b88; }
.tr-tier .tr-ic img { width: 100%; height: 100%; }
.tr-tier.lock .tr-ic { filter: grayscale(1) brightness(.55); }
.tr-tier .tr-lk { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; }
.tr-tier .tr-lk svg { width: 20px; height: 20px; }
.tr-tier .tr-nm { font-size: 9.5px; font-weight: 800; color: #e8d6b0; white-space: nowrap; text-shadow: 0 1px 2px #000; margin-top: -4px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
.tr-tier.on .tr-nm { color: #ffe08a; }
.tr-have { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 2px 14px; border-radius: 10px; background: #0d0906cc; border: 1px solid #8a6420; font-size: 12px; color: #e8d6b0; z-index: 1; }
.tr-count { display: grid; grid-template-columns: 34px 1fr 34px 76px; gap: 6px; align-items: center; margin: 8px 0; }
.tr-pm { height: 34px; border-radius: 50%; border: 1px solid #c08f2c; background: radial-gradient(#3a6a1a, #15400a); color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; padding: 0; }
.tr-n { text-align: center; padding: 6px; }
.tr-n { direction: ltr; }
/* battle report */
.rp-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; margin: -4px -14px 0; }
.rp-side { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; text-align: center; }
.rp-side.att { background: linear-gradient(135deg, #8a1e1a, #3a0a08); }
.rp-side.def { background: linear-gradient(225deg, #1a3a7a, #08122e); }
.rp-face { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 2px solid #e0b252; background: #0d0906; display: grid; place-items: center; box-shadow: 0 3px 8px #000a; }
.rp-face .hero-art { aspect-ratio: auto; }
.rp-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.rp-face svg { width: 44px; height: 44px; }
.rp-nm { font-weight: 900; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000; }
.rp-sub { font-size: 11px; color: #e8d6b0; }
.rp-res { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 8px; font-family: var(--font-head); font-size: 26px; text-shadow: 0 2px 0 #000, 0 0 14px currentColor;
  background: linear-gradient(90deg, #3a0a08, #0d0906, #08122e); }
.rp-res.win { color: #ffe08a; } .rp-res.lose { color: #ff8a7a; }
.rp-res small { font-family: var(--font); font-size: 10px; color: #c8b48a; text-shadow: none; }
.rp-sec { margin: 10px 0 4px; text-align: center; font-family: var(--font-head); color: #3a2410; font-size: 15px; padding: 4px; border-radius: 6px;
  background: linear-gradient(#e8d2a2, #c8a868); border: 1px solid #8a6420; box-shadow: inset 0 1px 0 #fff8; }
.rp-tbl { border-radius: 8px; overflow: hidden; border: 1px solid #5a4426; background: linear-gradient(#f0e2bf, #e0cc9c); color: #3a2410; }
.rp-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr; align-items: center; padding: 5px 8px; font-size: 13px; font-weight: 800; border-bottom: 1px solid #c8a86888; text-align: center; }
.rp-row:last-child { border-bottom: 0; }
.rp-row .k { color: #5a3a18; font-weight: 700; }
.rp-row.h { background: #c8a868; font-size: 12px; }
.rp-row .red { color: #b0201a; } .rp-row .green { color: #1a7a2a; }
.rp-more { margin-top: 10px; }
.rp-more summary { cursor: pointer; text-align: center; color: #ffe08a; font-weight: 800; text-decoration: underline; }
.world .wring { z-index: 3; }
.world .wring .wr-name { position: absolute; left: 0; top: -96px; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-head); font-size: 14px; color: #ffe9b8;
  padding: 3px 14px; border-radius: 4px; background: linear-gradient(#3a2614f0, #1a110af0); border: 1px solid #c08f2c; box-shadow: 0 2px 8px #000a; }
.c2-radial .rb.off { filter: grayscale(1) brightness(.6); }

/* ===== compact HUD (more room for the city and the map) ===== */
:root { --nav-h: 56px; }
.hud { padding: 3px 6px 4px; }
.hud-av { width: 48px; height: 48px; }
.hud-av .av-img { inset: 6px; }
.hud-av .av-lv { min-width: 20px; height: 15px; line-height: 14px; font-size: 9.5px; bottom: -3px; }
.hud .res { font-size: 11px; }
.hud .res svg { width: 19px; height: 19px; }
.hud-line { margin-top: 1px; gap: 3px; }
.hud .vip { font-size: 10.5px; padding: 0 5px; }
.hud .power { height: 19px; font-size: 11.5px; }
.hud .power svg { width: 14px; height: 14px; }
.hud .hud-gems { height: 19px; font-size: 10.5px; }
.hud .hud-gems svg { width: 17px; height: 17px; }
.hud .hud-gems b { width: 12px; height: 12px; line-height: 11px; font-size: 10px; }
.hud-ic { width: 22px; height: 22px; padding: 1px; }
.hud-ic svg { width: 17px; height: 17px; }
.hud-ic .dot { min-width: 13px; height: 13px; line-height: 13px; font-size: 8.5px; top: -4px; left: -4px; }
.queue-bar { padding: 3px 8px; gap: 4px; }
.qchip { padding: 2px 6px; font-size: 11px; }
.nav { height: 56px; }
.navbtn { font-size: 10px; }
.navbtn .sock { width: 36px; height: 36px; }
.navbtn .sock svg { width: 29px; height: 29px; }
.navbtn.on .sock { transform: translateY(-6px) scale(1.08); }
.navbtn.on .lb { margin-top: -6px; }
.navbtn .dot { left: calc(50% - 21px); }
.fab { width: 42px; height: 42px; }
.fab svg { width: 26px; height: 26px; }
.fab .fl { font-size: 9px; bottom: -6px; padding: 0 4px; }
.city-fab { gap: 9px; top: 6px !important; left: 6px !important; }
.wbtns { gap: 9px !important; left: 6px !important; bottom: 8px !important; }
.wbtns .fab { font-size: 18px; }
.quest-tip { bottom: 6px; left: 54px; right: 6px; padding: 4px 8px; border-radius: 8px; }
.quest-tip .t { font-size: 12px; }
.quest-tip svg { width: 20px !important; height: 20px !important; }
.world .coords { top: 4px; right: 4px; }
.world .coords .chip, .world .legend .chip { font-size: 10.5px; padding: 1px 6px; }
.world .legend { top: 4px; left: 4px; }
.march-dock { top: 30px; width: min(232px, 64%); gap: 3px; }
.march-dock .md-card { padding: 2px 6px; }
.march-dock .md-b { width: 34px; }
.march-dock .md-b svg { width: 20px; height: 20px; }
.c2-radial .rb { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
.c2-radial .rb svg { width: 30px; height: 30px; }
.c2-radial .rb span { font-size: 10px; }

/* bottom chat bar */
.chatbar { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px; position: relative; z-index: 5;
  background: linear-gradient(#120c07f0, #0b0805f5); border-top: 1px solid #5a4426; font-size: 12px; }
.chatbar .cb-tab { flex: none; height: 20px; padding: 0 7px; border-radius: 10px; border: 1px solid #5a4426; background: #1a120b; color: #c8b48a; font-size: 10.5px; font-weight: 800; cursor: pointer; }
.chatbar .cb-tab.on { background: linear-gradient(#6a4a1e, #3a2614); color: #ffe08a; border-color: #c08f2c; }
.chatbar .cb-line { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: #e8dcc0; }
.chatbar .cb-line b { color: #ffcf6b; font-weight: 800; }
.chatbar .cb-open { flex: none; width: 24px; height: 24px; border: 0; background: none; padding: 0; cursor: pointer; }
.chatbar .cb-open svg { width: 22px; height: 22px; }
/* upgrade summary */
.lu-hero { position: relative; height: 200px; margin: -12px -14px 0; overflow: hidden; background: radial-gradient(ellipse at 50% 80%, #8a6a32 0%, #3a2814 45%, #0e0a06 100%); }
.lu-rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, #ffd36b22 0 6deg, transparent 6deg 18deg); animation: spin 30s linear infinite; pointer-events: none; }
.lu-art { position: absolute; inset: 10px 0 30px; z-index: 1; }
.lu-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px #000c); }
.lu-title { position: absolute; bottom: 6px; left: 0; right: 0; z-index: 2; text-align: center; text-shadow: 0 2px 0 #000; }
.lu-title b { display: block; font-family: var(--font-head); font-size: 20px; color: #ffe08a; }
.lu-title span { display: inline-block; margin-top: 2px; padding: 1px 14px; border-radius: 10px; background: linear-gradient(#3a6a1a, #15400a); border: 1px solid #e0b252; color: #fff; font-weight: 900; font-size: 13px; }
.lu-tbl { border-radius: 8px; overflow: hidden; border: 1px solid #5a4426; }
.lu-row { display: grid; grid-template-columns: 1.6fr 1fr 18px 1fr; align-items: center; gap: 4px; padding: 6px 8px; font-size: 12.5px; border-bottom: 1px solid #3a2a16; background: #140d07; }
.lu-row:last-child { border-bottom: 0; }
.lu-row.h { background: #2a1d10; color: #c8b48a; font-size: 11px; font-weight: 800; }
.lu-row .k { color: #e8dcc0; font-weight: 700; }
.lu-row .old { color: #a8a294; text-align: center; }
.lu-row .new { color: #e8dcc0; text-align: center; font-weight: 900; }
.lu-row.up .new { color: #5fd17f; }
.lu-row .arr { color: #c08f2c; text-align: center; }
.rp-why { background: linear-gradient(#2a1d10, #140d07); }
.rp-heroes { background: #120c07; border: 1px solid #3a2a16; border-radius: 8px; padding: 6px; }
.rp-hero { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; }
.rp-hero .ic { width: 38px; height: 46px; flex: none; border-radius: 6px; overflow: hidden; border: 1px solid #6b4f28; }
.rp-hero .t { font-size: 12px; font-weight: 800; }
.rp-troops { margin-top: 6px; border: 1px solid #3a2a16; border-radius: 8px; padding: 6px; background: #120c07; }
.rp-trow { display: grid; grid-template-columns: 1.9fr 1fr 1fr 1fr 1fr; gap: 3px; align-items: center; font-size: 11.5px; padding: 3px 2px; border-bottom: 1px dashed #2a1d10; }
.rp-trow.h { color: #c8b48a; font-weight: 800; font-size: 10.5px; }
.rp-unit { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rp-unit > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-uic { width: 22px; height: 22px; flex: none; border-radius: 4px; overflow: hidden; background: #2a1d10; }
.rp-uic img { width: 100%; height: 100%; }
.rp-eff summary { cursor: pointer; font-size: 11px; color: #ffcf6b; margin-top: 4px; }
.rp-phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rp-phase { background: #140d07; border: 1px solid #3a2a16; border-radius: 8px; padding: 5px; }
.world canvas { filter: saturate(1.12) contrast(1.05); }
/* hero stage (full-length art) */
.hero-stage { position: relative; height: 330px; margin: -12px -14px 10px; overflow: hidden; border-bottom: 2px solid #5a4426;
  background: radial-gradient(ellipse at 50% 92%, #6a5232 0%, #2a1d10 45%, #0e0a06 80%); }
.hero-stage.r-legendary { background: radial-gradient(ellipse at 50% 85%, #8a5a10 0%, #3a2408 45%, #0e0a06 82%); }
.hero-stage.r-epic { background: radial-gradient(ellipse at 50% 85%, #4a2a6a 0%, #22103a 45%, #0e0a06 82%); }
.hero-stage.r-rare { background: radial-gradient(ellipse at 50% 85%, #1a3a6a 0%, #0e1a3a 45%, #0e0a06 82%); }
.hs-glow { position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 70%, #ffd36b14 0 5deg, transparent 5deg 15deg); }
.hs-art { position: absolute; left: 50%; bottom: 34px; height: 300px; transform: translateX(-50%); filter: drop-shadow(0 10px 16px #000d); }
.hero-stage.painted { height: min(520px, 134vw); }
.hero-stage.painted .hs-glow { display: none; }
.hero-stage.painted .hs-art { inset: 0; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform: none; filter: none; }
.hero-stage.painted::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 0 1px #c9a24b66, inset 0 0 40px #000a; }
.hero-stage.painted .hs-name { z-index: 2; padding-top: 40px; }
.hs-name { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; padding: 4px 0 6px; background: linear-gradient(transparent, #0e0a06ee 40%); }
.hs-name b { display: block; font-family: var(--font-head); font-size: 19px; color: #ffe08a; text-shadow: 0 2px 0 #000; }
.hs-name span { font-size: 11.5px; color: #e8dcc0; margin: 0 4px; }
.sheet-wrap { isolation: isolate; } .sheet { isolation: isolate; }

/* ===================== top bar v2 ===================== */
.hud { padding: 6px 8px 5px; background: linear-gradient(180deg, #2a1b0e 0%, #140d07 60%, #0b0704 100%); }
.hud::before { content: ''; position: absolute; inset: 0; background: var(--carved) center / auto 100%; opacity: .25; pointer-events: none; }
.h2 { position: relative; }
.h2-top { display: flex; align-items: center; gap: 7px; }
.h2-av { position: relative; width: 56px; height: 56px; flex: none; padding: 0; border: 0; background: none; cursor: pointer; }
.h2-av .av-img { position: absolute; inset: 5px; border-radius: 50%; overflow: hidden; background: #000; box-shadow: inset 0 0 0 2px #000; }
.h2-av .av-img svg { width: 100%; height: 100%; display: block; }
.h2-av::after { content: ''; position: absolute; inset: -2px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.h2-av .av-lv { position: absolute; z-index: 1; bottom: -4px; inset-inline-start: -4px; min-width: 22px; height: 22px; line-height: 20px; border-radius: 50%; font-size: 11px; font-weight: 900;
  color: #2a1600; background: radial-gradient(#fff3b8, #e0b04a 60%, #a8701c); border: 1px solid #4a3008; box-shadow: 0 2px 4px #000; text-align: center; }
.h2-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.h2-name { font-weight: 900; font-size: 13px; color: #fff3d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.h2-name b { color: #8fc8ff; }
/* combat power: a crimson plaque with a gold sword medallion */
.h2-power { position: relative; display: flex; align-items: center; height: 28px; padding: 0 10px 0 4px; padding-inline-start: 30px; border-radius: 15px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, #8a1c14 0%, #5a0e08 48%, #3e0804 52%, #6a140c 100%); border: 1px solid #e8b64c;
  box-shadow: inset 0 1px 0 #ffb08a66, inset 0 -2px 4px #0006, 0 2px 6px #000a; color: #fff; text-align: start; }
.h2-power::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, #ffffff30, transparent); animation: pw-shine 4.5s ease-in-out infinite; }
@keyframes pw-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.pw-emblem { position: absolute; inset-inline-start: -3px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(#5a3a14, #1a0e04 70%); border: 2px solid #e8b64c; box-shadow: 0 0 0 1px #000, 0 2px 6px #000; }
.pw-emblem svg { width: 24px; height: 24px; }
.pw-txt { display: flex; flex-direction: column; line-height: 1; }
.pw-txt i { font-style: normal; font-size: 8.5px; font-weight: 800; color: #ffcf9a; letter-spacing: .2px; }
.pw-txt b { font-size: 14px; font-weight: 900; background: linear-gradient(#fff8d8, #ffd36b 55%, #e09a2a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #000); direction: ltr; }
.h2-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.h2-row { display: flex; gap: 5px; align-items: center; }
.h2-vip { display: flex; align-items: baseline; gap: 1px; height: 26px; padding: 0 7px; border-radius: 7px; cursor: pointer; direction: ltr;
  background: linear-gradient(#3a2a6a, #1a0e3a); border: 1px solid #c8a0ff; box-shadow: inset 0 1px 0 #ffffff33, 0 2px 4px #000a; color: #fff; line-height: 26px; }
.h2-vip i { font-style: normal; font-size: 10px; font-weight: 900; color: #e8d0ff; }
.h2-vip b { font-size: 14px; font-weight: 900; color: #ffe08a; }
.h2-gems { display: flex; align-items: center; gap: 3px; height: 26px; padding: 0 3px 0 4px; border-radius: 13px; cursor: pointer; direction: ltr;
  background: linear-gradient(#123a4a, #061a22); border: 1px solid #6ad8ff; color: #e8fbff; font-weight: 900; font-size: 12.5px; box-shadow: inset 0 1px 0 #ffffff33, 0 2px 4px #000a; }
.h2-gems svg { width: 22px; height: 22px; }
.h2-gems b { width: 18px; height: 18px; line-height: 17px; border-radius: 50%; background: linear-gradient(#7ad35a, #2f8a2a); color: #fff; font-size: 14px; text-align: center; border: 1px solid #e0ffd0; }
.h2-chips { display: flex; gap: 4px; }
.h2-chips:empty { display: none; }
.h2-chips .hud-ic { width: 26px; height: 26px; }
.h2-chips .hud-ic svg { width: 20px; height: 20px; }
/* resources: five capsules with a fill line (share of the storage) */
.h2-res { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 6px; }
.h2-r { position: relative; display: flex; align-items: center; gap: 2px; height: 24px; padding: 0 5px 0 2px; border-radius: 12px; cursor: pointer; overflow: hidden; direction: ltr;
  background: linear-gradient(#0c0805, #1e150c); border: 1px solid #6b4f28; box-shadow: inset 0 2px 4px #000c; color: #fff6e0; font-weight: 900; font-size: 11.5px; min-width: 0; }
.h2-r svg { width: 24px; height: 24px; flex: none; margin: -3px 0 -3px -3px; position: relative; z-index: 1; }
.h2-r .num { position: relative; z-index: 1; flex: 1; text-align: center; text-shadow: 0 1px 2px #000; }
.h2-r .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #6ab83a, #c8f07a); border-radius: 2px; }
.h2-r.full { border-color: #f0a020; }
.h2-r.full .num { color: #ffbe5a; }
.h2-r.full .fill { background: linear-gradient(90deg, #e05a20, #ffb04a); }

/* ===================== bottom bar v2: seven framed tiles, the active one raised ===================== */
.nav { grid-template-columns: repeat(7, 1fr); height: 70px; padding: 0 4px; background: linear-gradient(180deg, #1e140b, #0b0704); }
.navbtn { justify-content: flex-end; padding-bottom: 6px; font-size: 10.5px; color: #cdb48a; }
.navbtn .plate { position: absolute; inset: 7px 3px 4px; border-radius: 10px; background: linear-gradient(#2a1d10, #120c07); border: 1px solid #4a3620; box-shadow: inset 0 1px 0 #ffd36b22; transition: all .18s; }
.navbtn .sock { width: 40px; height: 40px; margin-bottom: 1px; z-index: 1; }
.navbtn .sock::before { display: none; }
.navbtn .sock svg { width: 36px; height: 36px; filter: drop-shadow(0 2px 2px #000c); }
.navbtn .lb { position: relative; z-index: 1; margin: 0; font-weight: 800; }
.navbtn.on .plate { top: -6px; background: linear-gradient(#6a4416, #2a1808 70%); border-color: #f0c560; box-shadow: 0 0 12px #ffcf6b66, inset 0 1px 0 #fff3; }
.navbtn.on .sock { transform: translateY(-6px) scale(1.15); }
.navbtn.on .sock::after { display: none; }
.navbtn.on .lb { margin: 0; color: #ffe9a8; }
.navbtn .dot { top: 4px; left: auto; inset-inline-end: 4px; z-index: 2; }
@media (max-width: 420px) {
  .nav { height: 62px; }
  .navbtn { font-size: 9.5px; padding-bottom: 4px; }
  .navbtn .sock { width: 34px; height: 34px; }
  .navbtn .sock svg { width: 31px; height: 31px; }
  .h2-r { font-size: 10.5px; }
}

/* ===================== quest tracker (city side) ===================== */
.quest-side { position: absolute; z-index: 3; top: 10px; right: 8px; width: 168px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.quest-side > * { pointer-events: auto; }
.qs-head { display: flex; align-items: center; gap: 5px; align-self: flex-start; height: 30px; padding: 0 10px 0 6px; border-radius: 15px; cursor: pointer; position: relative;
  background: linear-gradient(#3a2610, #1a0f06); border: 1px solid #c08f2c; color: #ffe9b0; font-weight: 900; font-size: 12.5px; box-shadow: 0 3px 8px #000a; }
.qs-head svg { width: 22px !important; height: 22px !important; }
.qs-head b { color: #e0b252; font-size: 16px; }
.qs-head .badge { position: static; }
.qs-list { display: flex; flex-direction: column; gap: 4px; }
.qs-row { background: linear-gradient(90deg, #1a1008ee, #2a1a0cee); border: 1px solid #6b4f28; border-radius: 9px; padding: 5px 7px; cursor: pointer; box-shadow: 0 3px 8px #0009; }
.qs-row.done { border-color: #6ad04a; box-shadow: 0 0 10px #6ad04a55; }
.qs-k { font-size: 9px; font-weight: 900; color: #e0b252; }
.qs-t { font-size: 11.5px; font-weight: 800; color: #fff3d6; line-height: 1.3; }
.qs-bar { height: 4px; border-radius: 2px; background: #000a; margin: 4px 0 3px; overflow: hidden; }
.qs-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c08f2c, #ffe08a); }
.qs-row.done .qs-bar i { background: linear-gradient(90deg, #3c9a32, #9af07a); }
.qs-f { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: #cdb48a; }
.qs-btn { border: 1px solid #a87a2c; background: linear-gradient(#5a4026, #2a1a0c); color: #ffe7b0; font-size: 10.5px; font-weight: 900; border-radius: 6px; padding: 1px 8px; cursor: pointer; }
.qs-btn.claim { background: linear-gradient(#7ad35a, #2f8a2a); color: #fff; border-color: #e0ffd0; animation: pulse 1.4s infinite; }
.qs-all { align-self: flex-start; border: 0; background: none; color: #e0b252; font-size: 11px; font-weight: 800; text-decoration: underline; cursor: pointer; text-shadow: 0 1px 2px #000; }
.city3d.moving::after { content: 'وضع النقل — اختر المكان الجديد'; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 6px 14px; border-radius: 16px;
  background: #1a6a2acc; border: 1px solid #9af07a; color: #fff; font-weight: 900; font-size: 13px; pointer-events: none; }
.fab.explore::after { filter: hue-rotate(160deg); }
.quest-side { width: 146px; }
.qs-row { padding: 4px 6px; background: linear-gradient(90deg, #1a1008d9, #2a1a0cd9); }
.qs-t { font-size: 10.5px; }
.qs-k { font-size: 8.5px; }

/* ===================== full-screen game screens ===================== */
.sheet.screen { height: 100%; max-height: 100%; border-radius: 0; animation: fade .15s;
  background: radial-gradient(ellipse at 50% 0%, #3a2612 0%, transparent 60%), linear-gradient(#1c130b, #0e0905), var(--carved) center top / 520px auto, #0e0a06; }
.sheet.screen::before { display: none; }
.sheet-wrap:has(.sheet.screen) { background: #000; }
.scr-head { position: relative; height: 60px; padding: 0 14px; border-radius: 0; border-bottom: 0; justify-content: center;
  background: linear-gradient(#000a, #0006), var(--carved) center / auto 100%, #24170c; box-shadow: 0 4px 10px #000c; }
.scr-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--trim); }
.scr-head h2 { flex: none; font-size: 22px; letter-spacing: .5px; }
.scr-back { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: radial-gradient(#4a3014 0%, #1a0f06 70%); box-shadow: 0 3px 8px #000c; color: #ffe08a; font-size: 22px; font-weight: 900; display: grid; place-items: center; }
.scr-back::after { content: ''; position: absolute; inset: -3px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.scr-back span { transform: scaleX(-1); display: block; text-shadow: 0 2px 2px #000; }
[dir=ltr] .scr-back { left: auto; right: 6px; } [dir=ltr] .scr-back span { transform: none; }
.sheet.screen .sheet-body { padding: 8px 8px 20px; }
.sec-title { position: relative; text-align: center; margin: 14px 0 10px; }
.sec-title span { display: inline-block; padding: 6px 34px; font-family: var(--font-head); font-size: 18px; color: #ffe8b0; text-shadow: 0 2px 0 #000;
  background: linear-gradient(90deg, transparent, #3a2410 20%, #4a2e12 50%, #3a2410 80%, transparent); border-top: 1px solid #8a6420; border-bottom: 1px solid #8a6420; }
.empty-art { text-align: center; padding: 40px 10px; color: #b8a27a; } .empty-art svg { opacity: .35; }
.rdot { position: absolute; top: -5px; inset-inline-end: -4px; min-width: 18px; height: 18px; line-height: 17px; border-radius: 9px; background: radial-gradient(#ff5a4a, #b0100a); color: #fff; font-size: 10px; font-weight: 900; padding: 0 3px; border: 1px solid #ffd0a0; z-index: 2; }
.rdot:empty { width: 18px; padding: 0; }
.new, .ev-new { position: absolute; top: -6px; inset-inline-start: -2px; z-index: 2; padding: 1px 8px 3px; font-size: 10.5px; font-weight: 900; color: #fff; text-shadow: 0 1px 1px #000;
  background: linear-gradient(#e8402a, #9a1408); clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%); }
/* gold screen tabs */
.stabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 4px 0 8px; }
.stabs button { position: relative; min-height: 44px; padding: 6px 4px; border-radius: 4px; cursor: pointer; font-family: var(--font-head); font-size: 15px; color: #c9b48c;
  background: linear-gradient(#3a2a18, #1e140a); border: 1px solid #5a4426; box-shadow: inset 0 1px 0 #ffd36b22, 0 2px 4px #000a; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.stabs button.on { color: #3a1e00; text-shadow: 0 1px 0 #fff6; background: linear-gradient(#fff0b8 0%, #f0c560 30%, #c8902c 60%, #e0b04a 100%); border-color: #4a3008; }
.stabs .ts { font-family: var(--font); font-size: 11px; font-weight: 800; opacity: .9; direction: ltr; }
.stabs.big button { min-height: 50px; font-size: 18px; }
.stabs.small { overflow-x: auto; grid-auto-columns: minmax(64px, 1fr); scrollbar-width: none; }
.stabs.small button { min-height: 34px; font-size: 13px; font-family: var(--font); font-weight: 800; }
.stabs.mail { overflow-x: auto; grid-auto-columns: minmax(96px, 1fr); scrollbar-width: none; padding-top: 4px; }
.stabs.mail button { min-height: 52px; font-size: 14px; }

/* ---------- items ---------- */
.igrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.itile { position: relative; aspect-ratio: 1; border-radius: 4px; padding: 0; cursor: pointer; overflow: visible; border: 2px solid #2a2a2a; box-shadow: inset 0 0 0 1px #0008, 0 2px 4px #000a;
  background: radial-gradient(circle at 50% 40%, #6a6a6a, #2a2a2a 75%); }
.itile.uncommon { background: radial-gradient(circle at 50% 40%, #2a9a6a, #0a3a2a 75%); }
.itile.rare { background: radial-gradient(circle at 50% 40%, #2a6ad0, #0a1e4a 75%); }
.itile.epic { background: radial-gradient(circle at 50% 40%, #8a3ad8, #2a0a4a 75%); }
.itile.legendary { background: radial-gradient(circle at 50% 40%, #f0b020, #6a3a04 75%); }
.itile::after { content: ''; position: absolute; inset: 0; border-radius: 3px; box-shadow: inset 0 0 0 1px #ffffff22, inset 0 -10px 14px #0006; pointer-events: none; }
.itile .iart { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 3px 3px #000a); }
.itile div.iart svg { width: 100%; height: 100%; }
.itile .ishard { position: absolute; inset: 10%; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); overflow: hidden; }
.itile .ishard .hero-art, .itile .ishard img { width: 100%; height: 100%; object-fit: cover; }
.ilabel { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: 15px; font-weight: 900; color: #ffe24a; direction: ltr;
  text-shadow: 0 0 2px #000, 0 2px 0 #000, 1px 0 0 #000, -1px 0 0 #000; z-index: 1; }
.iqty { position: absolute; bottom: 1px; left: 4px; font-size: 15px; font-weight: 900; color: #fff; direction: ltr; text-shadow: 0 0 2px #000, 0 2px 0 #000, 1px 0 0 #000, -1px 0 0 #000; z-index: 1; }
.iprice { position: absolute; left: 0; right: 0; bottom: -14px; text-align: center; font-size: 11px; font-weight: 900; color: #ffe08a; z-index: 1; }
.iprice svg { width: 13px; height: 13px; vertical-align: -2px; }
.scr-bag .igrid:has(.iprice) { row-gap: 20px; }
.ifoot { position: sticky; bottom: -20px; margin: 12px -8px -20px; padding: 10px 8px 14px; display: flex; gap: 8px; background: linear-gradient(#0000, #0e0905 30%); }
.isearch { flex: 1; border-radius: 22px; background: linear-gradient(#efe4c4, #d8c89c); color: #3a2a10; border: 2px solid #8a6a3a; padding: 8px 14px; font-weight: 700; }
.isearch::placeholder { color: #6a5530; }
.ifoot .btn { border-radius: 22px; min-width: 90px; }
.idetail { display: flex; gap: 12px; align-items: flex-start; } .idetail > .itile { width: 96px; flex: none; }

/* ---------- events ---------- */
.ev-clock { text-align: center; color: #6ad04a; font-weight: 900; font-size: 15px; direction: ltr; text-shadow: 0 1px 2px #000; margin: 2px 0 6px; }
.ev-banner { position: relative; height: 190px; margin: 0 -8px; overflow: hidden; cursor: pointer; border-top: 2px solid #8a6420; border-bottom: 2px solid #8a6420;
  background: linear-gradient(90deg, #1a1008, #3a2410); }
.ev-banner .ev-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(1.1); }
.ev-banner .ev-hero { position: absolute; z-index: 1; bottom: -40%; left: 50%; transform: translateX(-50%); height: 175%; object-fit: contain; filter: drop-shadow(0 0 12px #000); }
.ev-btitle { position: absolute; z-index: 2; top: 0; left: 0; right: 0; text-align: center; padding: 6px; font-family: var(--font-head); font-size: 18px; color: #ffe8b0; background: linear-gradient(#000c, #0000); text-shadow: 0 2px 0 #000; }
.ev-bstage { position: absolute; z-index: 2; top: 38px; inset-inline-end: 0; padding: 3px 12px; background: #000b; color: #8ae05a; font-weight: 900; font-size: 14px; border-radius: 0 0 0 8px; }
.ev-dots { position: absolute; z-index: 2; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.ev-dots i { width: 10px; height: 10px; transform: rotate(45deg); border: 1px solid #c08f2c; background: #0008; cursor: pointer; }
.ev-dots i.on { background: #3ad0b0; box-shadow: 0 0 6px #3ad0b0; }
.ev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; padding: 6px 2px; }
.ev-card { position: relative; cursor: pointer; text-align: center; padding: 26px 6px 10px; min-height: 170px; display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(#2e3a30, #1a221c); border: 2px solid #6a5a32; border-radius: 48% 48% 6px 6px / 22% 22% 6px 6px; box-shadow: inset 0 0 0 2px #0006, 0 4px 10px #000c; }
.ev-card::before { content: ''; position: absolute; top: -9px; left: 50%; width: 2px; height: 14px; background: #8a6420; }
.ev-card::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 4px; height: 3px; background: var(--trim); opacity: .7; border-radius: 2px; }
.ev-med { width: 84%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid #c08f2c; box-shadow: 0 0 0 2px #2a1a08, 0 4px 10px #000c; background: #120c07; display: grid; place-items: center; }
.ev-med img { width: 100%; height: 100%; object-fit: cover; }
.ev-name { margin-top: 8px; font-family: var(--font-head); font-size: 14.5px; color: #fff3d6; text-shadow: 0 1px 2px #000; line-height: 1.3; }
.ev-sub { margin-top: 3px; font-size: 11px; font-weight: 800; color: #8ae05a; line-height: 1.3; }
.ev-sub b { direction: ltr; display: inline-block; }
.ev-card .ev-new { top: 2px; inset-inline-start: 6px; background: none; clip-path: none; color: #ffb060; font-family: var(--font-head); font-size: 14px; text-shadow: 0 0 6px #ff6a2a, 0 1px 0 #000; }
.scr-evd .evd-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.evd-img { width: 110px; height: 110px; border-radius: 50%; border: 3px solid #c08f2c; object-fit: cover; box-shadow: 0 4px 12px #000c; }
.evd-meta { display: flex; flex-direction: column; gap: 3px; } .evd-meta b { font-family: var(--font-head); font-size: 19px; color: #ffe08a; } .evd-meta span { font-size: 13px; font-weight: 700; }
.evd-score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.evd-score > div { text-align: center; padding: 8px; border-radius: 8px; background: linear-gradient(#3a2410, #1a1008); border: 1px solid #8a6420; }
.evd-score i { display: block; font-style: normal; font-size: 11px; color: #cdb48a; } .evd-score b { font-size: 20px; color: #ffe08a; }
.evd-rules > div { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px dashed #4a3620; font-size: 13px; } .evd-rules b { color: #8ae05a; }
.evd-step { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: radial-gradient(#fff0b8, #c8902c); color: #3a1e00; }

/* ---------- mail ---------- */
.parch { min-height: 56vh; margin: 0 -8px; padding: 10px 12px; border-top: 3px solid #6a5032; border-bottom: 3px solid #6a5032;
  background: radial-gradient(ellipse at 50% 45%, #e6dcc2 0%, #cdbf9c 70%, #b4a47e 100%); box-shadow: inset 0 0 40px #6a5a3a88; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-bottom: 1px solid #a89870; cursor: pointer; color: #3a2a14; }
.mrow.unread { background: #fff6; }
.mrow.unread .mt { font-weight: 900; }
.mrow.unread .mic::after { content: ''; position: absolute; top: -2px; inset-inline-end: -2px; width: 10px; height: 10px; border-radius: 50%; background: #d22; border: 1px solid #fff; }
.mic { position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%; background: radial-gradient(#5a4026, #2a1a0c); border: 2px solid #8a6420; display: grid; place-items: center; }
.mic svg { width: 30px; height: 30px; }
.mt { font-size: 14px; font-weight: 700; color: #2a1a08; } .md { font-size: 11.5px; color: #6a5530; }
.mstar { color: #c08f2c; font-size: 18px; } .matt svg { filter: drop-shadow(0 0 4px #ffcf6b); }
.mempty { text-align: center; padding: 26vh 10px 0; color: #7a5a30; font-weight: 800; }
.memb { width: 130px; height: 130px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #a8906066; box-shadow: 0 0 0 10px #a8906022; opacity: .55; filter: sepia(1) saturate(.6); }
.mfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 6px 0; }
.mfoot .btn { min-height: 48px; font-size: 15px; clip-path: polygon(6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%); border-radius: 0; }
.mcompose { display: flex; align-items: center; gap: 6px; margin: 12px auto 0; border: 1px solid #8a6420; background: #1a1008; color: #ffe08a; border-radius: 16px; padding: 4px 14px; font-weight: 800; cursor: pointer; }

/* ---------- rankings ---------- */
.rk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; padding: 14px 4px; border-radius: 8px;
  background: linear-gradient(#0000, #0000), repeating-linear-gradient(180deg, #1a120a 0, #1a120a 210px, #0e0905 210px, #0e0905 218px); }
.rk-card { position: relative; border: 0; background: none; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; }
.rk-med { width: 88%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 4px solid #c8a04a; box-shadow: 0 0 0 3px #2a1a08, 0 6px 12px #000c; background: #1a2a18; display: grid; place-items: center; position: relative; z-index: 1; }
.rk-med img { width: 100%; height: 100%; object-fit: cover; }
.rk-gem { width: 16px; height: 20px; margin-top: -10px; z-index: 2; background: linear-gradient(#9af07a, #2a8a2a); clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); filter: drop-shadow(0 0 4px #6ad04a); }
.rk-name { width: 92%; margin-top: -8px; padding: 14px 4px 18px; min-height: 64px; font-family: var(--font-head); font-size: 14px; color: #fff3d6; text-shadow: 0 1px 2px #000; line-height: 1.3;
  background: linear-gradient(#3a6a2a, #1a3a12); border: 2px solid #c8a04a; clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); display: grid; place-items: center; }
.rkl-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; } .rkl-img { width: 84px; height: 84px; border-radius: 50%; border: 3px solid #c8a04a; object-fit: cover; }
.rkl-head b { display: block; font-family: var(--font-head); font-size: 19px; color: #ffe08a; }
.rkl-list { display: flex; flex-direction: column; gap: 5px; }
.rk-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: linear-gradient(90deg, #2a1d10, #1a1008); border: 1px solid #4a3620; }
.rk-row.me { border-color: #6ad04a; box-shadow: 0 0 8px #6ad04a55; }
.rk-n { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-weight: 900; color: #e8d8b0; font-size: 15px; }
.rk-row.r1 .rk-n, .rk-row.r2 .rk-n, .rk-row.r3 .rk-n { border-radius: 50%; color: #2a1600; }
.rk-row.r1 .rk-n { background: radial-gradient(#fff3b8, #e0a020); box-shadow: 0 0 8px #ffcf4a; } .rk-row.r1 .rk-n::before { content: '1'; }
.rk-row.r2 .rk-n { background: radial-gradient(#ffffff, #9aa8b8); } .rk-row.r2 .rk-n::before { content: '2'; }
.rk-row.r3 .rk-n { background: radial-gradient(#ffd8b0, #b06a2a); } .rk-row.r3 .rk-n::before { content: '3'; }
.rk-row.r1 { background: linear-gradient(90deg, #4a3410, #1a1008); border-color: #c8a04a; }
.rk-av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 1px solid #8a6420; flex: none; } .rk-av svg { width: 100%; height: 100%; }
.rk-v { font-weight: 900; color: #ffe08a; } .blue { color: #8fc8ff; }

/* ---------- commander page ---------- */
.scr-pf { margin: -8px -8px -20px; padding-bottom: 6px; background: linear-gradient(#0000 0%, #0000 60%, #0b0704 100%); }
.pf-name { position: relative; margin: 10px auto 0; width: 70%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; font-size: 17px; color: #fff;
  background: linear-gradient(90deg, transparent, #0009 15%, #000b 50%, #0009 85%, transparent); border-top: 1px solid #8a642088; border-bottom: 1px solid #8a642088; }
.pf-edit { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #8a6420; background: linear-gradient(#5a4026, #2a1a0c); cursor: pointer; display: grid; place-items: center; padding: 0; }
.pf-edit svg { width: 22px; height: 22px; }
.pf-stage { position: relative; height: 58vh; min-height: 380px; max-height: 560px; overflow: hidden; }
.pf-arch { position: absolute; left: 16%; right: 16%; top: 2%; bottom: 0; border-radius: 50% 50% 0 0 / 22% 22% 0 0; border: 3px solid #8a6420aa;
  background: radial-gradient(ellipse at 50% 30%, #6a4a24 0%, #3a2612 45%, #1a1008 80%), repeating-linear-gradient(60deg, #ffffff06 0 2px, #0000 2px 14px); box-shadow: inset 0 0 40px #000c; }
.pf-hero { position: absolute; left: 50%; bottom: -12%; transform: translateX(-50%); height: 120%; object-fit: contain; filter: drop-shadow(0 0 14px #000); }
.pf-avatar { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); width: 50%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; } .pf-avatar svg { width: 100%; height: 100%; }
.pf-col { position: absolute; top: 14%; display: flex; flex-direction: column; gap: 10px; z-index: 2; } .pf-col.l { left: 8px; } .pf-col.r { right: 8px; }
.pf-slot { position: relative; width: 66px; height: 66px; border-radius: 6px; cursor: pointer; padding: 6px; background: linear-gradient(#2a2016, #120c07); border: 2px solid #4a3a26; box-shadow: inset 0 0 12px #000, 0 2px 6px #000c; }
.pf-slot svg { width: 100%; height: 100%; }
.pf-ghost { display: block; width: 100%; height: 100%; opacity: .28; filter: grayscale(1); }
.pf-slot.r-uncommon { border-color: #3ab070; } .pf-slot.r-rare { border-color: #3a7ae0; } .pf-slot.r-epic { border-color: #a055e8; } .pf-slot.r-legendary { border-color: #f0b020; box-shadow: 0 0 10px #f0b02088; }
.pf-lv { position: absolute; bottom: 1px; right: 4px; font-size: 11px; color: #9af07a; text-shadow: 0 1px 1px #000; }
.pf-chip { position: absolute; z-index: 2; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 5px 26px; border-radius: 16px; cursor: pointer; color: #fff3d6; font-size: 15px;
  background: linear-gradient(#2a1d10, #0e0905); border: 1px solid #c08f2c; box-shadow: 0 2px 8px #000; }
.pf-stats { display: grid; grid-template-columns: 1fr 1.3fr 1fr; text-align: center; padding: 10px 6px; background: linear-gradient(#0000, #0009); }
.pf-stats > div { border-inline-start: 1px solid #8a642066; } .pf-stats > div:first-child { border: 0; }
.pf-stats i { display: block; font-style: normal; font-size: 13px; color: #d8c39b; } .pf-stats b { font-size: 18px; color: #fff; }
.pf-stats .main b { font-size: 24px; background: linear-gradient(#fff8d8, #ffd36b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pf-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; direction: ltr; }
.pf-plus { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #c08f2c; background: radial-gradient(#6a4a1e, #2a1808); color: #ffe08a; font-weight: 900; font-size: 18px; cursor: pointer; padding: 0; flex: none; }
.pf-track { position: relative; flex: 1; height: 20px; border-radius: 10px; background: #0a0604; border: 1px solid #5a4426; overflow: hidden; box-shadow: inset 0 2px 4px #000; }
.pf-track i { position: absolute; inset: 0 auto 0 0; border-radius: 10px; }
.pf-bar.xp .pf-track i { background: linear-gradient(#7ac8ff, #2a7ad0 60%, #1a4a90); }
.pf-bar.st .pf-track i { background: linear-gradient(#b8f07a, #4aa82a 60%, #2a6a14); }
.pf-track span { position: absolute; inset: 0; text-align: center; line-height: 19px; font-size: 12.5px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; }
.pf-bic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(#5a1a12, #1a0604); border: 2px solid #c08f2c; } .pf-bic svg { width: 24px; height: 24px; }
.pf-acts { display: flex; justify-content: space-around; padding: 12px 8px 4px; }
.pf-act { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #e8d8b0; font-weight: 800; font-size: 13px; text-shadow: 0 1px 2px #000; }
.pf-ring { width: 54px; height: 54px; display: grid; place-items: center; transform: rotate(45deg); border: 2px solid #c08f2c; border-radius: 10px; background: radial-gradient(#4a3014, #1a0f06); box-shadow: 0 3px 8px #000c; }
.pf-ring svg { width: 36px; height: 36px; transform: rotate(-45deg); }
.pf-navs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; padding: 12px 6px 6px; border-top: 3px solid transparent; border-image: var(--trim) 1; background: linear-gradient(#1a120a, #0b0704); }
.pf-nav { position: relative; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff3d6; font-weight: 800; font-size: 13px; font-family: var(--font-head); }
.pf-crest { width: 64px; height: 56px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 60%, #3a5a3a, #142014 70%); border: 2px solid #c8a04a;
  clip-path: polygon(50% 0, 100% 22%, 92% 80%, 50% 100%, 8% 80%, 0 22%); } .pf-crest svg { width: 38px; height: 38px; }
.stabs { margin-top: 12px; }
.ev-sub b { direction: rtl; unicode-bidi: isolate; }
.rk-grid, .ev-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.igrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rk-card, .ev-card, .itile { min-width: 0; }
.rk-grid { background: linear-gradient(#1a120a, #120c07); }
.pf-navs { position: sticky; bottom: -20px; z-index: 3; }
.scr-mail { display: flex; flex-direction: column; min-height: calc(100dvh - 92px); } .scr-mail .parch { flex: 1; }
.scr-bag { display: flex; flex-direction: column; min-height: calc(100dvh - 92px); } .scr-bag .ifoot { margin-top: auto; }
.sheet.screen .sheet-body { overflow-x: hidden; } .stabs.small, .stabs.mail { max-width: 100%; }

/* ---------- lord data ---------- */
.ld-top { display: flex; gap: 10px; align-items: center; padding: 8px 4px 12px; border-bottom: 1px solid #5a4426; }
.ld-av { position: relative; width: 86px; height: 86px; flex: none; border: 2px solid #8a6420; border-radius: 4px; overflow: hidden; background: #000; } .ld-av svg { width: 100%; height: 100%; }
.ld-swap { position: absolute; bottom: 2px; inset-inline-start: 2px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #c08f2c; background: #1a1008cc; padding: 2px; cursor: pointer; } .ld-swap svg { width: 100%; height: 100%; }
.ld-id { flex: 1; min-width: 0; }
.ld-name { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: linear-gradient(90deg, #0008, #0004); border: 1px solid #5a4426; border-radius: 4px; font-size: 16px; }
.ld-meta { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 14px; color: #e8d8b0; } .ld-meta b { color: #fff; }
.ld-uid { align-self: center; display: flex; align-items: center; gap: 4px; border: 0; background: none; color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; direction: ltr; } .ld-uid svg { width: 22px; height: 22px; }
.ld-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 4px; }
.ld-stat { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: #e8d8b0; margin-bottom: 6px; } .ld-stat svg { width: 26px; height: 26px; flex: none; } .ld-stat b { color: #fff; }
.ld-band { margin: 10px -4px 4px; padding: 9px; text-align: center; font-family: var(--font-head); font-size: 17px; color: #ffe8b0; text-shadow: 0 2px 0 #000;
  background: linear-gradient(#3a2814, #24170c); border: 2px solid #6b4f28; border-radius: 4px; box-shadow: inset 0 0 0 1px #c08f2c55; }
.ld-list .ld-row { display: flex; justify-content: center; gap: 10px; padding: 9px 6px; font-size: 15px; color: #f1e6c8; }
.ld-list .ld-row:nth-child(even) { background: #ffffff0a; } .ld-row b { color: #fff; min-width: 40px; }

/* ---------- skills tree ---------- */
.scr-sk { margin: -8px -8px -20px; min-height: calc(100dvh - 60px); padding: 8px 8px 0; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 30% 20%, #2a3a5a55, transparent 60%), radial-gradient(ellipse at 70% 70%, #3a2a5a44, transparent 60%), radial-gradient(1px 1px at 20% 30%, #fff8, transparent), radial-gradient(1px 1px at 80% 60%, #fff6, transparent), radial-gradient(1px 1px at 50% 85%, #fff6, transparent), #0b1220; }
.sk-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 13px; color: #d8e8ff; background: #0006; border-radius: 16px; border: 1px solid #3a5a7a; }
.sk-pts b, .sk-bar b { color: #ffe08a; }
.sk-trees { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px; scrollbar-width: none; }
.sk-tree { flex: none; display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 14px 0 4px; border-radius: 28px; cursor: pointer; color: #fff;
  background: linear-gradient(90deg, #1a2a20, #0e1810); border: 2px solid #5a6a4a; clip-path: none; }
.sk-tree.t-mil { background: linear-gradient(90deg, #4a1410, #1a0806); border-color: #8a3a2a; } .sk-tree.t-eco { background: linear-gradient(90deg, #1a3a4a, #081a22); border-color: #3a7a8a; }
.sk-tree.t-def { background: linear-gradient(90deg, #1a2a5a, #080e22); border-color: #4a6aaa; } .sk-tree.t-exp { background: linear-gradient(90deg, #1a4a24, #081a0c); border-color: #4a9a4a; }
.sk-tree.on { border-color: #ffd36b; box-shadow: 0 0 10px #ffcf6b88; }
.sk-tic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(#5a4a3a, #1a120a); border: 2px solid #c8a04a; } .sk-tic svg { width: 32px; height: 32px; }
.sk-tn { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-head); font-size: 14px; } .sk-tn b { font-size: 16px; color: #8ae05a; }
.sk-map { position: relative; margin: 8px 0 12px; }
.sk-lines { position: absolute; inset: 0; pointer-events: none; } .sk-lines svg { display: block; }
.sk-node { position: absolute; transform: translateX(-50%); width: 104px; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 0; }
.sk-circle { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(#8a2a1a, #3a0a06 75%);
  border: 3px solid #c8a04a; box-shadow: 0 0 0 2px #1a0e04, 0 4px 10px #000c; }
.sk-circle img { width: 92%; height: 92%; object-fit: contain; } .sk-circle svg { width: 50px; height: 50px; }
.sk-lv { margin-top: -14px; z-index: 1; padding: 1px 10px; border-radius: 10px; background: linear-gradient(#5a4026, #2a1a0c); border: 1px solid #c8a04a; color: #fff; font-size: 13px; font-weight: 900; direction: ltr; }
.sk-name { margin-top: 3px; padding: 1px 8px; font-size: 12.5px; font-weight: 800; color: #fff3d6; text-shadow: 0 1px 2px #000; background: linear-gradient(90deg, transparent, #000a, transparent); white-space: nowrap; max-width: 116px; overflow: hidden; text-overflow: ellipsis; }
.sk-node.locked .sk-circle { filter: grayscale(1) brightness(.6); border-color: #6a6a6a; } .sk-node.locked .sk-lv { filter: grayscale(1); }
.sk-node.done .sk-lv { background: linear-gradient(#3c9a32, #1a4a14); }
.sk-node.run .sk-circle { box-shadow: 0 0 0 2px #1a0e04, 0 0 18px #ffcf4a; animation: pulse 1.4s infinite; }
.sk-foot { position: sticky; bottom: 0; margin: auto -8px 0; padding: 12px; background: linear-gradient(#0000, #0b1220 30%); display: flex; justify-content: center; }
.sk-btn { display: flex; flex-direction: column; align-items: center; min-width: 200px; padding: 6px 24px; border-radius: 10px; cursor: pointer; color: #fff3d6; font-weight: 800;
  background: linear-gradient(#8a5a1a, #5a3408); border: 2px solid #ffd36b; clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); }
.sk-btn b { color: #ffe08a; } .sk-btn i { font-style: normal; font-size: 12px; color: #8ae05a; }
.sk-idle { color: #a8c0e0; font-size: 13px; }

/* ---------- armory ---------- */
.arm-heroes { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.arm-hero { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; padding: 0; border: 2px solid #5a4426; background: #000; cursor: pointer; }
.arm-hero.on { border-color: #ffd36b; box-shadow: 0 0 8px #ffcf6b; } .arm-hero .hero-art, .arm-hero img { width: 100%; height: 100%; object-fit: cover; }
.arm-stage { height: 360px; min-height: 0; margin: 0 -8px; }
.pf-slot img { width: 100%; height: 100%; object-fit: contain; }
.pf-sn { position: absolute; left: 0; right: 0; bottom: 2px; font-size: 10px; font-style: normal; color: #a89870; text-align: center; }
.pf-ghost svg { width: 100%; height: 100%; }
.ienh { position: absolute; top: 2px; right: 4px; font-size: 12px; font-weight: 900; color: #9af07a; text-shadow: 0 1px 1px #000; z-index: 1; }
.iworn { position: absolute; bottom: 1px; right: 3px; font-size: 10px; font-weight: 900; color: #fff; background: #1a6a2acc; border-radius: 6px; padding: 0 4px; z-index: 1; }
.arm-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- world map controls v2 ---------- */
.world .coords { display: none; }
.world .wbtns { top: 46px; bottom: auto !important; left: 6px !important; gap: 12px !important; }
.wside { position: relative; width: 62px; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: #fff3d6; font-size: 10.5px; font-weight: 900; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.wside svg { width: 50px; height: 50px; filter: drop-shadow(0 3px 4px #000c); }
.wside .new { top: -4px; inset-inline-start: 0; }
.wzoom { position: absolute; z-index: 2; right: 8px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.wzoom button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #c08f2c; background: radial-gradient(#4a3014, #1a0f06); color: #ffe08a; font-size: 20px; font-weight: 900; cursor: pointer; }
.wbar { position: absolute; z-index: 2; left: 6px; right: 6px; bottom: 8px; display: flex; align-items: center; gap: 6px; direction: ltr; }
.wb-pin, .wb-search { width: 50px; height: 50px; flex: none; border-radius: 50%; cursor: pointer; padding: 0; position: relative; display: grid; place-items: center;
  background: radial-gradient(#5a3a1a, #1a0f06 70%); border: 0; box-shadow: 0 3px 8px #000c; font-size: 22px; }
.wb-pin::after, .wb-search::after, .wb-big::after { content: ''; position: absolute; inset: -3px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.wb-pin svg { width: 32px; height: 32px; }
.wb-coords { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; border-radius: 4px;
  background: linear-gradient(90deg, #1a1008dd, #2a1d10ee, #1a1008dd); border: 1px solid #6b4f28; color: #fff; font-weight: 900; font-size: 15px; white-space: pre; }
.wb-pen { color: #e0b252; font-size: 16px; }
.wb-big { position: relative; width: 66px; height: 66px; flex: none; border-radius: 50%; border: 0; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(#6a4a1e, #1a0f06 72%); color: #ffe9b8; font-size: 9.5px; font-weight: 900; box-shadow: 0 4px 10px #000c; }
.wb-big svg { width: 38px; height: 38px; }
.world .legend { top: 6px; left: 6px; }
.scr-sk > *, .scr-bag > *, .scr-mail > *, .scr-pf > *, .scr-arm > * { min-width: 0; max-width: 100%; }
.sk-trees { max-width: calc(100% + 0px); }

/* skills: smaller nodes, art sits inside the circle */
.sk-node { width: 88px; }
.sk-circle { width: 62px; height: 62px; border-width: 2px; }
.sk-circle img { width: 74%; height: 74%; object-fit: contain; }
.sk-circle svg { width: 36px; height: 36px; }
.sk-lv { margin-top: -10px; font-size: 11.5px; padding: 0 8px; }
.sk-name { font-size: 11.5px; max-width: 96px; }

/* every tab strip uses the gold game tabs */
.tabs { display: flex; gap: 4px; padding: 0; margin: 12px 0 10px; background: none; border: 0; border-radius: 0; overflow-x: auto; }
.tabs button { flex: 1 0 auto; min-height: 40px; padding: 6px 12px; border-radius: 4px; font-family: var(--font-head); font-size: 14.5px; font-weight: 400; color: #c9b48c;
  background: linear-gradient(#3a2a18, #1e140a); border: 1px solid #5a4426; box-shadow: inset 0 1px 0 #ffd36b22, 0 2px 4px #000a; }
.tabs button.on { color: #3a1e00; text-shadow: 0 1px 0 #fff6; background: linear-gradient(#fff0b8 0%, #f0c560 30%, #c8902c 60%, #e0b04a 100%); border-color: #4a3008; box-shadow: none; }
.tabs .dot { top: -5px; left: -3px; border: 1px solid #ffd0a0; }
/* grids never grow wider than the screen because of a picture's natural size */
.hero-grid, .grid2, .grid3, .grid4, .slots { min-width: 0; }
.hero-grid > *, .grid2 > *, .grid3 > *, .grid4 > *, .igrid > *, .ev-grid > *, .rk-grid > * { min-width: 0; }
.hero-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sheet.screen .hero-card img, .sheet.screen .hero-art img { max-width: 100%; }
.more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; padding: 6px 0 10px; }
.more-it { position: relative; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #f1e6c8; }
.more-ring { position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(#4a3218, #1a1008 72%); box-shadow: 0 4px 10px #000a; }
.more-ring::after { content: ''; position: absolute; inset: -4px; background: var(--ring) center / contain no-repeat; pointer-events: none; }
.more-ring svg { width: 42px; height: 42px; }
.more-lb { font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; text-align: center; line-height: 1.2; }
.more-it .rdot { top: -2px; inset-inline-end: 6px; }
.al-head { display: flex; gap: 12px; align-items: center; padding: 12px; margin: 0 -8px; background: linear-gradient(90deg, #3a2410, #1a1008), var(--carved) center / auto 100%; border-bottom: 2px solid #8a6420; }
.al-emb { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 4px 8px #000); }
.al-id { display: flex; flex-direction: column; gap: 3px; } .al-id b { font-family: var(--font-head); font-size: 19px; color: #ffe08a; } .al-id > span { font-size: 12.5px; color: #cdb48a; }
.al-nums { display: flex; gap: 10px; font-size: 13px; font-weight: 800; } .al-nums span { display: flex; align-items: center; gap: 3px; } .al-nums svg { width: 16px; height: 16px; }
.al-grid { margin: 8px 0 12px; }
.ar-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.ar-stat { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 8px; background: linear-gradient(#2e2114, #1a1008); border: 1px solid #5a4426; }
.ar-stat b { font-size: 15px; color: #fff; } .ar-stat i { font-style: normal; font-size: 10.5px; color: #cdb48a; text-align: center; }
.ar-train > div { display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-top: 4px; border-radius: 8px; background: #1a3a12aa; border: 1px solid #4a8a2a; font-size: 13px; }
.ar-train b { margin-inline-start: auto; color: #9af07a; }
.itile .iart.unit { object-fit: cover; object-position: 50% 15%; inset: 4%; width: 92%; height: 92%; border-radius: 2px; }
.itile:has(.unit) { overflow: hidden; } .itile .iart.unit { transform: scale(1.5); transform-origin: 50% 28%; object-fit: contain; }
.sh-wallet { display: flex; justify-content: center; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.sh-wallet span { display: flex; align-items: center; gap: 3px; padding: 2px 10px; border-radius: 12px; background: #0008; border: 1px solid #5a4426; font-weight: 800; font-size: 13px; }
.sh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.sh-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 8px; background: linear-gradient(#2a1d10, #140d07); border: 1px solid #5a4426; min-width: 0; }
.sh-cell .itile { width: 76%; }
.sh-cell.sold { opacity: .5; }
.sh-name { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.25; min-height: 30px; }
.sh-left { font-size: 10.5px; color: #cdb48a; }
.sh-buy { width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 5px; border-radius: 6px; cursor: pointer; font-weight: 900; font-size: 13px; color: #2a1600;
  background: linear-gradient(#fff0b8, #e0b04a 50%, #c8902c); border: 1px solid #4a3008; }
.sh-buy svg { width: 16px; height: 16px; } .sh-buy[disabled] { filter: grayscale(1); }
.rw-item { display: inline-block; width: 46px; vertical-align: middle; }
.rw-item .itile { width: 46px; border-width: 1px; }
.rw-item .ilabel { font-size: 10px; } .rw-item .iqty { font-size: 11px; }
.cost:has(.rw-item) { align-items: center; gap: 4px; }

/* tablets (iPad): use most of the screen instead of a phone-width column */
@media (min-width: 700px) {
  #app, .sheet-wrap { max-width: 900px; }
  .igrid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ev-grid, .rk-grid, .sh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .more-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- quiet note in the middle of the screen (march arrived) ---------- */
.cnotes{position:fixed;left:50%;top:40%;transform:translateX(-50%);z-index:9000;pointer-events:none;display:flex;flex-direction:column;align-items:center;gap:6px;max-width:92vw}
.cnote{pointer-events:none;padding:8px 18px;border-radius:999px;background:rgba(20,14,8,.9);border:1px solid rgba(224,178,82,.5);color:#f6e7c4;
  font-size:13px;font-weight:700;max-width:92vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-shadow:0 4px 14px rgba(0,0,0,.35);animation:cnoteIn .25s ease-out;transition:opacity .55s,transform .55s}
.cnote.ok{border-color:rgba(110,210,120,.6);color:#d8ffd9}
.cnote.out{opacity:0;transform:translateY(-14px)}
@keyframes cnoteIn{from{transform:translateY(12px) scale(.96)}to{transform:none}}
/* lord character portraits used as avatars */
.av-pic { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.av-pic.contain { object-fit: contain; }
/* ---------- the lord: his own painted character inside the arch, royal gear sheet, character picker ---------- */
.pf-hero.pf-lord { left: 16%; top: 2%; bottom: auto; transform: none; width: 68%; height: 98%; object-fit: cover; object-position: 50% 12%;
  border-radius: 50% 50% 0 0 / 22% 22% 0 0; filter: none; -webkit-mask-image: linear-gradient(#000 78%, #0000); mask-image: linear-gradient(#000 78%, #0000); }
.pf-slot img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 3px #000a); }
.lg-stats { margin: 12px 0 6px; display: grid; gap: 6px; }
.lg-stat { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: linear-gradient(90deg, #2a1d1088, #0000); border: 1px solid #8a642044; }
.lg-stat span { flex: 1; color: #e8d6b0; font-size: 14px; } .lg-stat b { color: #9af07a; } .lg-stat i { font-style: normal; color: #ffe08a; font-size: 13px; }
.lg-band { margin: 12px 0 6px; text-align: center; color: #ffe08a; font-size: 14px; background: linear-gradient(90deg, #0000, #8a642055, #0000); padding: 4px; }
.lg-need { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #ffffff10; font-size: 14px; }
.lg-need.short b { color: #ff7a6a; } .lg-need b { color: #cfe8b0; }
.lg-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; } .lg-ic svg, .lg-ic img { width: 100%; height: 100%; object-fit: contain; }
.lg-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lg-look { padding: 0; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid #4a3a26; background: #120c07; }
.lg-look img, .lg-look span, .lg-look svg { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 10%; }
.lg-look.on { border-color: var(--gold); box-shadow: 0 0 0 2px #e0b25288, 0 0 14px #e0b25255; }
@media (min-width: 700px) { .lg-pick { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ===================== top bar floats over the view (no backdrop) ===================== */
.game { position: relative; }
.topwrap { position: absolute; top: 0; left: 0; right: 0; z-index: 6; pointer-events: none; padding-top: env(safe-area-inset-top); }
.topwrap > * { pointer-events: auto; }
.topwrap .hud { background: none; box-shadow: none; border: 0; }
.topwrap .hud::before, .topwrap .hud::after { display: none; }
.topwrap .queue-bar { background: none; border: 0; }
.h2-name { text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 8px #000a; }
.h2-r { background: linear-gradient(#0c0805d9, #1e150cd9); }
/* controls that sit at the top of a view start below the floating bar */
.quest-side { top: calc(var(--top-h, 0px) + 6px); }
.city-fab { top: calc(var(--top-h, 0px) + 6px) !important; }
.world .wbtns { top: calc(var(--top-h, 0px) + 6px); }
.march-dock { top: calc(var(--top-h, 0px) + 8px); }
.world .coords { top: calc(var(--top-h, 0px) + 4px); }
.world .legend { top: calc(var(--top-h, 0px) + 4px); }
.city3d.moving::after { top: calc(var(--top-h, 0px) + 8px); }
#toasts { top: calc(var(--top-h, 100px) + 10px); }

/* ===================== peace shield in the top bar: clear blue badge with its timer ===================== */
.h2-shield { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 9px 0 3px; border-radius: 15px; cursor: pointer; direction: rtl;
  background: linear-gradient(#2a6ae0, #0f2f80); border: 1.5px solid #bfe0ff; color: #fff;
  box-shadow: 0 0 10px #5aa8ffcc, inset 0 1px 0 #ffffff55; animation: shd-glow 2.2s ease-in-out infinite; }
.h2-shield .shd-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(#e8f4ff, #7ab8ff 60%, #2a5ac0); box-shadow: 0 0 6px #fff8; }
.h2-shield .shd-ic svg { width: 20px; height: 20px; }
.h2-shield .shd-t { display: flex; flex-direction: column; line-height: 1.05; text-align: start; }
.h2-shield .shd-t i { font-style: normal; font-size: 9px; font-weight: 800; color: #d8ecff; }
.h2-shield .shd-t b { font-size: 12.5px; font-weight: 900; color: #fff; direction: ltr; text-shadow: 0 1px 2px #0008; }
@keyframes shd-glow { 0%, 100% { box-shadow: 0 0 8px #5aa8ff99, inset 0 1px 0 #ffffff55; } 50% { box-shadow: 0 0 16px #8ac8ffff, inset 0 1px 0 #ffffff55; } }

/* daily-quest chests: a compact row of small chests (tap a glowing one to open) */
.qchests { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; }
.qchest { flex: 0 0 auto; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 0 2px; border-radius: 10px;
  background: rgba(0,0,0,.25); border: 1px solid rgba(201,162,75,.25); color: var(--muted, #b9a77f); font-size: 11px; line-height: 1.1; }
.qchest:disabled { opacity: 1; cursor: default; }
.qchest .qc-ic { width: 28px; height: 28px; display: block; }
.qchest .qc-ic > * { width: 100%; height: 100%; }
.qchest .qc-ic img, .qchest .qc-ic svg { width: 28px; height: 28px; object-fit: contain; }
.qchest:not(.ready):not(.got) .qc-ic { filter: grayscale(.6) brightness(.75); }
.qchest.ready { border-color: #f2c94c; color: #ffe08a; box-shadow: 0 0 10px rgba(242,201,76,.55); animation: qcPulse 1.4s ease-in-out infinite; cursor: pointer; }
.qchest.got { opacity: .55; color: #5fd17f; }
@keyframes qcPulse { 50% { transform: translateY(-2px); box-shadow: 0 0 16px rgba(242,201,76,.8); } }

/* combat power: a small plaque sized to its number (was stretched across the whole bar) */
.h2-power { align-self: flex-start; width: max-content; max-width: 100%; height: 22px; padding: 0 9px 0 3px; padding-inline-start: 25px; border-radius: 12px; }
.h2-power .pw-emblem { width: 26px; height: 26px; border-width: 1.5px; }
.h2-power .pw-emblem svg { width: 17px; height: 17px; }
.h2-power .pw-txt { flex-direction: row; align-items: baseline; gap: 5px; }
.h2-power .pw-txt i { font-size: 8px; }
.h2-power .pw-txt b { font-size: 12px; }
.h2-shield .shd-t b { direction: rtl; unicode-bidi: isolate; }   /* "1ي 0س" read right-to-left */
.slot .slot-art, .slot .slot-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.item .ic img.av-pic.contain { width: 100%; height: 100%; object-fit: contain; }

/* live announcement from the control panel: slim bar under the HUD */
.ann-bar { position: absolute; z-index: 40; top: calc(var(--top-h, 120px) + 6px); left: 50%; transform: translateX(-50%); width: min(92%, 520px);
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #1d3a6e, #12244a); border: 1px solid #6aa8ff; box-shadow: 0 4px 14px #000a; animation: annIn .4s ease; }
.ann-bar.warn { background: linear-gradient(135deg, #6e3a12, #4a2208); border-color: #ffb02e; }
.ann-bar.gift { background: linear-gradient(135deg, #1e5a32, #0f3a1c); border-color: #5fd17f; }
.ann-bar .ann-t { flex: 1; line-height: 1.5; }
.ann-bar .ann-x { background: none; border: 0; color: #fff9; font-size: 18px; cursor: pointer; padding: 0 4px; }
@keyframes annIn { from { opacity: 0; transform: translate(-50%, -8px); } }
.boot.maint h1 { color: var(--gold2); }
/* "don't ask again" tick in the jewel confirmation */
.jw-skip { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 14px; color: #e8d9b5; cursor: pointer; }
.jw-skip input { width: 20px; height: 20px; accent-color: #c99a2e; margin: 0; }
.h2-av .av-dot { top: -2px; inset-inline-end: -2px; }

/* building names over the city (setting "إظهار أسماء المباني", on by default) */
body.city-names .c3-lbl .nm { display: block !important; font-size: 11px; padding: 1px 8px; }
body.city-names .c3-overlay.far .c3-lbl .nm { font-size: 9.5px; padding: 0 5px; }
body.city-names .c3-lbl.small .nm { font-size: 10px; }
/* VIP not activated: the badge is greyed */
.h2-vip.off { filter: grayscale(1); opacity: .7; }
.vip-act { margin-bottom: 10px; border-color: #8a3a2a; }
.vip-act.on { border-color: #3f8a4a; }
.vip-act .grid3 .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; }

/* tier-6 troops: gold aura until their own paintings land */
.t6-aura, img.t6-aura, .t6-aura img { filter: drop-shadow(0 0 4px #ffd66a) drop-shadow(0 0 10px #ff9a2a) saturate(1.25) brightness(1.08); }
/* six tiers in the training column: a little tighter so all of them fit */
.tr-tiers { gap: 2px; top: 4px; bottom: 30px; }
.tr-tier { height: 46px; }
.tr-tier .tr-ic { width: 38px; height: 38px; }
.tr-tier .tr-lk { top: 9px; }

/* hero roles and wall posts */
.hero-card .lv.role { color: #ffd27a; font-size: 10.5px; }
.role-card b { color: #ffe08a; }
.post-card { margin-top: 8px; }

/* ten tiers in the training column: scrolls when it does not fit */
.tr-tiers { justify-content: flex-start; overflow-y: auto; scrollbar-width: none; }
.tr-tiers::-webkit-scrollbar { display: none; }
.tr-tier { flex: none; }

/* prince skills */
.psk.on { border-color: #3f8a4a; box-shadow: 0 0 0 1px #3f8a4a66 inset; }

/* prince skill tree */
.tl-wrap { background: radial-gradient(ellipse at 50% 30%, #1b2a48 0%, #0d1424 70%); margin: -8px -8px -20px; padding: 10px 8px 20px; min-height: 100%; }
.tl-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: space-between; }
.tl-pts { color: #f3dfa8; font-weight: 700; background: #2a1a12cc; border: 1px solid #8a6a3a; border-radius: 14px; padding: 4px 10px; font-size: 13px; }
.tl-pts b { color: #ffd56a; }
.tl-groups { display: flex; gap: 4px; }
.tl-grp { background: #2a2116; color: #cdb98d; border: 1px solid #6b5432; border-radius: 10px; padding: 4px 9px; font-size: 12px; }
.tl-grp.on { background: linear-gradient(#e9dcb4, #c9b37c); color: #3a2a12; font-weight: 700; }
.tl-act { display: flex; align-items: center; gap: 4px; background: #3a2414; color: #f3dfa8; border: 1px solid #a8803f; border-radius: 10px; padding: 4px 8px; font-size: 12px; }
.tl-act svg { width: 16px; height: 16px; }
.tl-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.tl-tab { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 22px 10px 10px 22px; border: 2px solid #5a4528; background: #1d1710; color: #e8dcc0; }
.tl-tab.on { border-color: #e7b84a; box-shadow: 0 0 10px #e7b84a66; }
.tl-tab-ic { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; border: 1px solid #a8803f; }
.tl-tab-ic img { width: 100%; height: 100%; object-fit: cover; }
.tl-tab-t { display: flex; flex-direction: column; line-height: 1.1; font-size: 13px; }
.tl-tab-t i { font-style: normal; font-weight: 700; font-size: 15px; }
.tl-tab.t-battle b, .tl-tab.t-battle i { color: #ff6b5a; } .tl-tab.t-dev b, .tl-tab.t-dev i { color: #5ab8ff; } .tl-tab.t-support b, .tl-tab.t-support i { color: #5ee07a; }
.tl-tree { position: relative; margin-top: 8px; }
.tl-svg, .tl-svg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-svg path { fill: none; stroke: #59657d; stroke-width: 2; vector-effect: non-scaling-stroke; }
.tl-svg path.on { stroke: #d8b25a; }
.tl-node { position: absolute; transform: translate(-50%, -44px); width: 104px; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; color: #f1e6cc; }
.tl-ring { position: relative; width: 78px; height: 78px; border-radius: 50%; border: 3px solid #6d6f78; background: #10182a; box-shadow: 0 2px 6px #000a; display: block; }
.tl-ring img, .tl-ph { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; }
.tl-node .tl-ring img { filter: grayscale(1) brightness(.75); transition: filter .2s; }
.tl-node.has .tl-ring { border-color: #d8b25a; } .tl-node.has .tl-ring img { filter: none; }
.tl-node.full .tl-ring { box-shadow: 0 0 12px #ffd56a99; }
.tl-node.lock { opacity: .75; }
.tl-node.act .tl-ring { border-radius: 18px; transform: rotate(45deg) scale(.86); } .tl-node.act .tl-ring img { border-radius: 14px; transform: rotate(-45deg) scale(1.38); }
.tl-node.act .tl-lv { transform: translateX(-50%) rotate(-45deg); bottom: -2px; left: 92%; }
.tl-lv { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: #1a1a1ae6; border: 1px solid #8a8f9a; border-radius: 9px; padding: 0 7px; font-size: 12px; color: #fff; white-space: nowrap; }
.tl-node.has .tl-lv { border-color: #d8b25a; color: #ffe39a; }
.tl-name { margin-top: 10px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; line-height: 1.2; }
.tl-foot { display: flex; justify-content: center; margin-top: 8px; }
.tl-reset { display: flex; align-items: center; gap: 6px; }
.tl-reset svg { width: 18px; height: 18px; }
.tl-ring.big { width: 72px; height: 72px; flex: none; border-color: #d8b25a; }
.tl-ring.big img { filter: none; }
/* prince active skills */
.ak-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px; padding: 6px 0; }
.ak-cell { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; color: inherit; padding: 6px 0; }
.ak-dia { position: relative; width: 70px; height: 70px; transform: rotate(45deg); border: 3px solid #6d6f78; border-radius: 10px; overflow: hidden; background: #10182a; box-shadow: 0 2px 6px #0008; margin: 8px; }
.ak-in { position: absolute; inset: 0; transform: rotate(-45deg) scale(1.42); }
.ak-in img { width: 100%; height: 100%; object-fit: cover; }
.ak-cell.s-lock .ak-in img, .ak-cell.s-rest .ak-in img { filter: grayscale(1) brightness(.6); }
.ak-cell.s-ready .ak-dia { border-color: #b98b3a; } .ak-cell.s-on .ak-dia { border-color: #4fc36a; box-shadow: 0 0 12px #4fc36a99; }
.ak-cell.sel .ak-dia { border-color: #ffd56a; box-shadow: 0 0 14px #ffd56acc; }
.ak-lock, .ak-cd, .ak-on { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-45deg); color: #fff; font-weight: 700; text-shadow: 0 1px 3px #000; font-size: 12px; }
.ak-lock svg { width: 26px; height: 26px; opacity: .9; }
.ak-on { color: #8dffa5; }
.ak-name { font-size: 12.5px; font-weight: 700; }
.ak-info { background: #00000026; border-radius: 10px; padding: 8px 10px; margin-top: 4px; text-align: center; }
.ak-title { color: #c9962f; font-size: 15px; }
.ak-info p { margin: 6px 0 0; }
.ak-use { display: block; margin: 10px auto 0; min-width: 150px; }
.ak-when { text-align: center; margin-top: 6px; font-size: 13px; font-weight: 700; }
.ak-when.red { color: #d0453a; } .ak-when.green { color: #2f8f46; }
.tl-node.act .tl-ring img { clip-path: polygon(50% 7%, 93% 50%, 50% 93%, 7% 50%); }
/* battle report: each army's stats */
.rp-trow.rp-e4 { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
.rp-ac { margin-top: 8px; }
.rp-ac-h { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; border-bottom: 1px solid #3a2a16; padding-bottom: 4px; }
.rp-eff { margin-top: 6px; }
.rp-eff small { font-size: 9.5px; }
/* قصر أزمار */
.th-hero { display: flex; justify-content: center; margin: -4px 0 4px; }
.th-hero img { width: 62%; max-width: 260px; filter: drop-shadow(0 8px 14px #0008); }
.th-status { text-align: center; padding: 8px; border-radius: 10px; background: #12361c; border: 1px solid #2f7a44; color: #d6f5dc; font-weight: 800; margin-bottom: 8px; }
.th-status.war { background: #4a1210; border-color: #c0392b; color: #ffd9d2; }
.th-ruler { border-color: #e0b252; background: linear-gradient(180deg, #3a2a10, #1c140a); }
.th-ruler h3 { margin: 0; color: #ffe08a; }
.th-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.th-title { padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.th-title.bad { border-color: #7a2a24; background: #261010; }
.th-chips { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0; }
.th-chip { font-size: 10.5px; padding: 1px 6px; border-radius: 9px; background: #1d3a1f; color: #bff0c4; border: 1px solid #2f6a36; }
.th-chip.bad { background: #3a1414; color: #ffb4aa; border-color: #7a2a24; }
.th-person { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-top: 2px; }
.th-person.empty { color: #8a7a60; font-weight: 400; }
.th-person.big { font-size: 15px; margin: 6px 0; }
.th-av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none; border: 1px solid #e0b252; }
.th-person.big .th-av { width: 42px; height: 42px; }
.th-av img, .th-av svg { width: 100%; height: 100%; object-fit: cover; }
.th-flag { width: 10px; height: 26px; flex: none; border-radius: 2px 2px 0 6px; box-shadow: inset 0 0 0 1px #0006, 0 1px 3px #0008; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.th-rulerline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-n { font-size: 12px; font-weight: 800; color: #1c140a; background: linear-gradient(180deg, #ffe08a, #c9962e); padding: 2px 10px; border-radius: 10px; }
.th-occ { margin-top: 8px; border-color: #c0392b; background: #2a1110; }
.th-garr { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 13px; }
.th-garr b { color: #ffe08a; }
.th-body { margin-top: 8px; min-height: 120px; }
.th-rk { gap: 8px; align-items: center; }
.th-rk.on { border-color: #4caf50; background: #12301a; }
.th-rk .rk-n { min-width: 22px; text-align: center; font-weight: 800; color: #ffe08a; }
.th-log { display: flex; flex-direction: column; gap: 4px; }
.th-logrow { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: #1a140c; border: 1px solid #3a2c18; }
.th-li { width: 20px; text-align: center; flex: none; }
.th-fame { gap: 8px; align-items: center; }
.th-fn { display: flex; flex-direction: column; align-items: center; min-width: 44px; color: #ffe08a; line-height: 1.1; }
.th-fn small { font-size: 10px; color: #c9a860; }
.th-fn b { font-size: 18px; }
.th-rules ul { margin: 6px 0; padding-inline-start: 18px; }
.th-rules li { margin: 3px 0; }
.st-throne { margin-top: 8px; border-color: #e0b252; }
.rl { display: grid; gap: 8px; }
.rl-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.rl-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 9px; border-radius: 10px; background: #10202a; border: 1px solid #2a5a6a; color: #d8eef5; font-size: 11px; position: relative; text-align: start; min-width: 0; }
.rl-chip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rl-chip.on { border-color: #5ac8e8; box-shadow: 0 0 10px #5ac8e833; }
.rl-chip.lock { background: #120e08; border-color: #3a2c18; color: #8a7a60; }
.rl-n { position: absolute; top: -6px; inset-inline-end: -4px; background: #e0b252; color: #1c140a; font-weight: 800; border-radius: 9px; padding: 0 6px; font-size: 10px; }
.rl-lane { padding: 8px; border-radius: 10px; background: #10202a; border: 1px solid #2a5a6a; display: flex; flex-direction: column; gap: 5px; }
.rl-lane.lock { background: #120e08; border-color: #3a2c18; opacity: .85; }
.rl-h { display: flex; justify-content: space-between; align-items: center; color: #a8d8e8; }
.rl-run { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; background: #0a3040; }
.rl-wait { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; background: #0c1820; }
.rl-i { width: 20px; height: 20px; border-radius: 50%; background: #2a5a6a; display: grid; place-items: center; font-size: 11px; flex: none; }
.mr-size { display: flex; align-items: center; gap: 4px; }
.mr-plus { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #e0b252; background: radial-gradient(circle at 40% 35%, #4caf50, #1d6a2a); color: #fff; font-size: 18px; font-weight: 900; line-height: 1; display: grid; place-items: center; margin-inline-start: 4px; box-shadow: 0 2px 5px #0008; }
.lg-plus { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 2px solid #e0b252; background: radial-gradient(circle at 40% 35%, #4caf50, #1d6a2a); color: #fff; font-size: 22px; font-weight: 900; line-height: 1; display: grid; place-items: center; box-shadow: 0 2px 6px #0008; }
.lg-bar { padding: 8px; border-radius: 10px; background: #1a140c; border: 1px solid #3a2c18; margin-bottom: 8px; }
.lg-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 6px; }
.lg-cell { display: flex; flex-direction: column; align-items: center; padding: 5px 2px; border-radius: 8px; border: 1px solid #3a2c18; font-size: 10px; line-height: 1.2; }
.lg-cell b { font-size: 14px; }
.lg-cell.free { border-color: #4caf50; background: #12301a; color: #bff0c4; }
.lg-cell.busy { border-color: #e0b252; background: #3a2a10; color: #ffe08a; }
.lg-cell.lock { color: #8a7a60; background: #120e08; }
.st-throne .th-part { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed #3a2c18; }
.cm.sys { justify-content: center; }
.cm.sys .cm-b { background: linear-gradient(180deg, #3a2a10, #22180a); border: 1px solid #e0b252; color: #ffe08a; text-align: center; max-width: 92%; }
/* buy with a quantity */
.by-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.by-head .ic { width: 64px; height: 64px; flex: none; position: relative; }
.by-row { display: flex; align-items: center; gap: 6px; direction: ltr; }
.by-tile { width: 72px; flex: none; position: relative; }
.by-tile > * { width: 100% !important; max-width: 72px; margin: 0 !important; position: relative !important; inset: auto !important; }
.by-range { flex: 1; accent-color: #e0b252; }
.by-step { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #8a6a2a; background: linear-gradient(#5a4220, #33240f); color: #ffe08a; font-size: 20px; font-weight: 900; }
.by-num { width: 64px; text-align: center; }
.by-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; justify-content: center; }
.by-sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; background: #1c140a; border: 1px solid #3a2a16; font-size: 13px; }
.by-cost { display: flex; gap: 8px; }
.by-cost span { display: inline-flex; align-items: center; gap: 3px; color: #ffe08a; }
/* battle report v3: banner, two-sided table, folding stat sections */
.rb { margin-top: 6px; }
.rb-banner { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 150px; border-radius: 10px; overflow: hidden; border: 1px solid #6a4a20;
  background: linear-gradient(110deg, #2b5aa8 0%, #1f3f78 47%, #8e1f16 53%, #c0392b 100%); box-shadow: inset 0 0 40px #0008; }
.rb-banner::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(110deg, #ffffff08 0 6px, transparent 6px 14px); pointer-events: none; }
.rb-side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; z-index: 1; min-width: 0; }
.rb-name { font-weight: 800; font-size: 13px; color: #fff; text-shadow: 0 1px 3px #000; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-side.def .rb-name { color: #cfe0ff; }
.rb-pos { font-size: 12px; color: #fff; text-decoration: underline; cursor: pointer; }
.rb-row { display: flex; align-items: center; gap: 6px; }
.rb-face { width: 64px; height: 64px; border: 2px solid #e0b252; border-radius: 6px; overflow: hidden; background: #1a1208; box-shadow: 0 3px 8px #0009; }
.rb-face img, .rb-face svg { width: 100%; height: 100%; object-fit: cover; }
.rb-ic { color: #ffe08a; filter: drop-shadow(0 2px 3px #000); }
.rb-res { z-index: 1; text-align: center; display: flex; flex-direction: column; }
.rb-res b { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 1px 1px 0 #3a2408, -1px -1px 0 #3a2408, 1px -1px 0 #3a2408, -1px 1px 0 #3a2408, 0 4px 0 #000, 0 0 16px #ffd36a99; }
.rb-banner.win .rb-res b { color: #ffe08a; }
.rb-res small { font-size: 10px; color: #f3e2c0; }
.rb-title { margin: 12px 0 6px; text-align: center; font-weight: 800; padding: 7px; border-radius: 8px; color: #3a2408;
  background: linear-gradient(#e9dcc0, #cdbb94); border: 1px solid #8a6a3a; box-shadow: inset 0 1px 0 #fff8; }
.rb-table, .rb-fold-b { background: #efe6d2; border-radius: 8px; border: 1px solid #b9a27a; overflow: hidden; }
.rb-tr { display: grid; grid-template-columns: 1.25fr .9fr 1.25fr .9fr; align-items: center; gap: 4px; padding: 7px 8px; color: #3a2a16; font-size: 12px; border-bottom: 1px solid #d8c9a8; }
.rb-tr:nth-child(odd) { background: #e6dbc2; }
.rb-tr .rb-v { font-weight: 800; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; direction: ltr; justify-content: flex-end; }
.rb-tr .rb-v.red, .rb-tr .rb-v .red { color: #c0392b; }
.rb-tr .rb-v.green { color: #2e8b3a; }
.rb-tr .rb-k { color: #4a3a22; }
.rb-tr > .rb-k:nth-child(3) { border-inline-start: 1px solid #cdbb94; padding-inline-start: 6px; }
.rb-ar { font-size: 11px; }
.rb-ar.up { color: #2e8b3a; } .rb-ar.dn { color: #c0392b; } .rb-ar.eq { color: #6a5a3a; }
.rb-link { display: inline-block; margin: 8px 0; color: #e0b252; text-decoration: underline; cursor: pointer; font-weight: 700; }
.rb-details { background: #1c140a; border: 1px solid #3a2a16; border-radius: 8px; padding: 6px; }
.rb-sub { font-weight: 800; font-size: 12px; margin: 6px 0 4px; color: #ffe08a; }
.rb-fold { margin-top: 6px; }
.rb-fold-h { display: flex; align-items: center; justify-content: center; position: relative; padding: 7px; background: #cfc2a4; color: #3a2408; font-weight: 800; border-radius: 8px 8px 0 0; border: 1px solid #a8916a; cursor: pointer; }
.rb-tri { position: absolute; inset-inline-start: 10px; color: #e08a1a; font-size: 13px; }
.rb-fold .rb-fold-b { border-radius: 0 0 8px 8px; border-top: 0; }
.rb-fold .rp-heroes { color: #3a2a16; padding: 6px; }
.rb-fold .rb-sub { color: #6a4a10; }
/* march screen: formations, commanders, a slider per troop type, the march bar */
.mr { padding-bottom: 8px; }
.mr-target { text-align: center; font-size: 12px; color: #c8b48a; margin-bottom: 6px; }
.mr-presets { display: flex; justify-content: center; gap: 14px; margin: 4px 0 10px; }
.mr-preset { position: relative; width: 50px; height: 50px; border-radius: 50%; border: 2px solid #6a4a20; background: radial-gradient(#3a2a14, #1a1208); color: #a08a60; display: grid; place-items: center; }
.mr-preset.on { border-color: #e0b252; color: #ffe08a; box-shadow: 0 0 8px #e0b25266; }
.mr-preset b { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: #1a1208; border: 1px solid #e0b252; border-radius: 10px; padding: 0 6px; font-size: 12px; color: #fff; }
.mr-heroes { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; }
.mr-hero { position: relative; flex: none; width: 66px; height: 84px; border-radius: 8px; overflow: hidden; border: 2px solid #4a3418; background: #1a1208; opacity: .55; cursor: pointer; }
.mr-hero.on { opacity: 1; border-color: #e0b252; box-shadow: 0 0 10px #e0b25288; }
.mr-hero.busy { filter: grayscale(1); opacity: .35; }
.mr-hp, .mr-hp img, .mr-hp svg { width: 100%; height: 100%; object-fit: cover; }
.mr-rar { position: absolute; top: 0; inset-inline-start: 3px; font: italic 900 18px serif; color: #ffe08a; text-shadow: 0 1px 2px #000; }
.mr-rar.epic { color: #e0a0ff; } .mr-rar.rare { color: #8ac8ff; } .mr-rar.common { color: #ddd; }
.mr-x { position: absolute; top: 2px; inset-inline-end: 2px; width: 20px; height: 20px; border-radius: 50%; background: #b0281a; color: #fff; font-weight: 900; display: grid; place-items: center; line-height: 1; border: 1px solid #ffb0a0; }
.mr-lv { position: absolute; bottom: 3px; inset-inline-start: 3px; min-width: 20px; height: 20px; border-radius: 50%; background: #1a1208; border: 1px solid #e0b252; color: #fff; font-size: 11px; display: grid; place-items: center; }
.mr-role { position: absolute; bottom: 3px; inset-inline-end: 3px; font-size: 9px; color: #ffe08a; background: #0009; padding: 0 3px; border-radius: 4px; }
.mr-settings { background: #1c140a; border: 1px solid #6a4a20; border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.mr-troops { display: flex; flex-direction: column; gap: 6px; }
.mr-tr { display: flex; gap: 8px; align-items: stretch; background: linear-gradient(#3a2a16, #2a1d0e); border: 1px solid #5a4020; border-radius: 6px; padding: 6px; }
.mr-uart { position: relative; width: 66px; flex: none; display: grid; place-items: center; }
.mr-uart img, .mr-uart svg { width: 62px; height: 62px; object-fit: contain; }
.mr-tier { position: absolute; bottom: 0; inset-inline-start: 0; font-weight: 900; color: #ffe08a; text-shadow: 0 1px 2px #000; font-size: 13px; }
.mr-tbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mr-thead { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mr-uname { font-weight: 800; color: #f3e2c0; font-size: 14px; }
.mr-cnt { display: flex; align-items: center; gap: 2px; direction: ltr; color: #e8d8b0; }
.mr-in { width: 72px; padding: 4px; background: #120c06; border: 1px solid #3a2a16; color: #fff; font-weight: 800; text-align: center; }
.mr-ctl { display: flex; align-items: center; gap: 6px; }
.mr-pm { width: 38px; height: 36px; flex: none; border-radius: 4px; border: 1px solid #b8a070; background: linear-gradient(#d8c8a0, #9a8660); color: #3a2a10; font-size: 22px; font-weight: 900; line-height: 1; }
.mr-range { flex: 1; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #f08a1a 0 var(--p, 0%), #2a1d0e var(--p, 0%)); direction: ltr; }
.mr-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: linear-gradient(#ffe08a, #c08a2a); border: 2px solid #6a4a10; box-shadow: 0 2px 4px #0008; }
.mr-range::-moz-range-thumb { width: 44px; height: 26px; border-radius: 13px; background: linear-gradient(#ffe08a, #c08a2a); border: 2px solid #6a4a10; }
.mr-bar { position: sticky; bottom: -8px; margin: 12px -8px -8px; padding: 8px 8px 10px; background: linear-gradient(#2a1d0e, #160f07); border-top: 2px solid #6a4a20; z-index: 2; }
.mr-hint { text-align: center; color: #5be06a; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.mr-stats { display: flex; justify-content: space-around; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.mr-stats > div { display: flex; align-items: center; gap: 4px; background: #120c06; border: 1px solid #3a2a16; border-radius: 16px; padding: 3px 10px; color: #fff; font-size: 13px; }
.mr-btns { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 6px; }
.mr-b { min-height: 48px; border-radius: 22px; font-weight: 800; font-size: 13px; color: #fff; border: 2px solid #b8a060; }
.mr-b.green { background: linear-gradient(#5aa04a, #2e6a24); }
.mr-b.go { background: linear-gradient(#f0a050, #b0561a); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.mr-b.go b { font-size: 14px; } .mr-b:disabled { filter: grayscale(.8); opacity: .6; }
/* march speed-up panel and the radial menu over an own march */
.hst-to { text-align: center; color: #c8b48a; font-size: 12px; margin-bottom: 8px; }
.hst-bar { position: relative; height: 30px; border-radius: 6px; background: #0e1a2e; border: 2px solid #8a7040; overflow: hidden; margin-bottom: 10px; }
.hst-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#4a8ae8, #1f4fa8); }
[dir=rtl] .hst-bar i { inset: 0 0 0 auto; }
.hst-bar b { position: relative; display: block; text-align: center; line-height: 26px; color: #fff; font-size: 15px; text-shadow: 0 1px 2px #000; }
.hst-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #3a2a16; }
.hst-ic { position: relative; width: 58px; height: 58px; flex: none; border: 2px solid #6a5a8a; border-radius: 6px; background: #1a2440; display: grid; place-items: center; overflow: visible; }
.hst-ic img { width: 100%; height: 100%; object-fit: contain; }
.hst-n { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #fff; }
.hst-name { font-size: 14px; color: #f3e2c0; font-weight: 700; }
.hst-use { min-width: 96px; height: 42px; border-radius: 20px; border: 2px solid #8a6a2a; background: linear-gradient(#f0c070, #c0802a); color: #3a2008; font-weight: 900; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.hst-use.sec { background: linear-gradient(#8a7a5a, #5a4a2a); color: #fff; }
.hst-use:disabled { filter: grayscale(.8); opacity: .6; }
.mring .mr-label { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); white-space: nowrap; text-align: center; background: #1a1208e6; border: 1px solid #e0b252; border-radius: 10px; padding: 4px 12px; color: #fff3cf; font-size: 12px; pointer-events: none; }
.mring .mr-label b { color: #ffe08a; }
.mr-slots { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 11px; color: #e8d8b0; margin-bottom: 2px; }
.mr-slot { padding: 1px 8px; border-radius: 10px; background: #1a1208; border: 1px solid #4a3418; color: #8a7a60; }
.mr-slot.on { border-color: #e0b252; color: #ffe08a; }
/* world minimap (top right) */
.minimap { position: absolute; top: 118px; inset-inline-start: 8px; width: 150px; height: 82px; z-index: 4; border-radius: 6px; background: #120c06cc; border: 1px solid #8a6a2a; box-shadow: 0 3px 10px #0008; touch-action: none; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.mini-btn { position: absolute; top: 204px; inset-inline-start: 8px; z-index: 4; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #8a6a2a; background: #1a1208e6; font-size: 15px; line-height: 1; }
/* chat v2: bubbles with portraits, the input pinned to the bottom of the screen */
.cm-sheet .sheet-body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; flex: 1; min-height: 0; }
.cm-screen { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
.cm-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 6px -10px 0; }
.cm-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(#0f0a05cc, #0f0a05cc), url('/art/city/backdrop_0.jpg') center / cover; }
.cm { display: flex; gap: 8px; align-items: flex-start; max-width: 88%; cursor: pointer; }
.cm.mine { flex-direction: row-reverse; align-self: flex-end; }
.cm-av { width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden; border: 2px solid #8a6a2a; background: #1a1208; }
.cm.mine .cm-av { border-color: #e0b252; }
.cm-av img, .cm-av svg { width: 100%; height: 100%; object-fit: cover; }
.cm-b { min-width: 0; }
.cm-h { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #c8b48a; margin-bottom: 2px; flex-wrap: wrap; }
.cm.mine .cm-h { justify-content: flex-end; }
.cm-h b { color: #ffe08a; font-size: 12.5px; }
.cm-tag { color: #8ac8ff; font-weight: 700; }
.cm-vip { background: linear-gradient(#ffd36b, #b8860b); color: #2a1a04; font-weight: 900; font-size: 9.5px; padding: 0 5px; border-radius: 6px; }
.cm-t { color: #7a6a50; font-size: 10px; }
.cm-text { background: #2a1f12; border: 1px solid #4a3418; color: #f3e8d0; padding: 7px 11px; border-radius: 4px 14px 14px 14px; font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; box-shadow: 0 2px 4px #0006; }
.cm.mine .cm-text { background: linear-gradient(#5a4220, #3e2c14); border-color: #8a6a2a; border-radius: 14px 4px 14px 14px; }
.cm-empty { margin: auto; color: #8a7a60; font-size: 13px; }
.cm-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(#2a1d0e, #160f07); border-top: 2px solid #6a4a20; }
.cm-in { flex: 1; height: 44px; border-radius: 22px; padding: 0 16px; background: #0f0a05; border: 1px solid #6a4a20; color: #fff; font-size: 15px; }
.cm-send { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2px solid #8a6a2a; background: linear-gradient(#f0c070, #c0802a); color: #3a2008; font-size: 20px; font-weight: 900; transform: scaleX(-1); }
.cm-menu { display: flex; flex-direction: column; gap: 8px; }
.cm-quote { background: #1c140a; border: 1px solid #3a2a16; border-radius: 8px; padding: 8px; color: #e8d8b0; font-size: 13px; word-break: break-word; }
/* daily activity (مهام النشاط اليومي) */
.act-top { display: flex; justify-content: space-between; align-items: center; color: #e8d8b0; font-size: 13px; margin: 2px 0 8px; }
.act-top b { color: #5be06a; font-size: 18px; }
.act-track { position: relative; padding: 4px 4px 6px; border-radius: 10px; background: linear-gradient(#1c140acc, #0f0a05cc), url('/art/city/backdrop_1.jpg') center / cover; border: 1px solid #4a3418; }
.act-bar { height: 10px; margin: 8px 10px 0; border-radius: 5px; background: #0b0805; border: 1px solid #6a4a20; overflow: hidden; }
.act-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f08a1a, #ffd36b); }
[dir=rtl] .act-bar i { margin-inline-start: 0; }
.act-chests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.act-chest { position: relative; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; }
.act-pts { color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 1px 2px #000; }
.act-img { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #6a4a20; background: radial-gradient(#3a2a14, #120c06); display: grid; place-items: center; overflow: hidden; }
.act-img img { width: 88%; height: 88%; object-fit: contain; }
.act-chest.ready .act-img { border-color: #ffd36b; box-shadow: 0 0 14px #ffd36b99; animation: pulse 1.4s infinite; }
.act-chest.got .act-img { filter: grayscale(.6) brightness(.7); }
.act-lock, .act-ok { position: absolute; top: 22px; inset-inline-end: 6px; font-size: 14px; }
.act-ok { color: #5be06a; font-weight: 900; }
.act-head { margin: 10px 0 6px; padding: 6px; text-align: center; font-weight: 800; color: #e8eef0; background: linear-gradient(#3e4a4a, #2a3434); border-radius: 6px; }
.act-list { display: flex; flex-direction: column; gap: 6px; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: linear-gradient(#e9dcc0, #d6c6a2); border: 2px solid #b9a27a; color: #3a2a16; }
.act-row.done { opacity: .7; }
.act-ic { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 8px; background: radial-gradient(#5a4220, #2a1d0e); color: #ffe08a; }
.act-ic b { position: absolute; bottom: -2px; inset-inline-end: 2px; color: #ffd36b; font-size: 15px; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.act-t { font-weight: 800; font-size: 14px; }
.act-d { font-size: 12px; color: #5a4a2a; } .act-d b { color: #2e8b3a; }
.act-p { position: relative; height: 16px; margin-top: 4px; border-radius: 3px; background: #2a1d0e; overflow: hidden; }
.act-p i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #2e8b3a, #5be06a); }
[dir=rtl] .act-p i { inset: 0 0 0 auto; }
.act-p span { position: relative; display: block; text-align: center; font-size: 11px; color: #fff; line-height: 16px; font-weight: 700; }
.act-fin { color: #2e8b3a; font-weight: 900; font-size: 12px; }
/* settings home: round gold buttons */
.set-stamp { display: flex; justify-content: center; align-items: center; gap: 10px; color: #f3e2c0; font-size: 17px; margin: 4px 0 14px; }
.set-stamp span { color: #a08040; }
.set-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
.set-it { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: #f3e2c0; }
.set-ring { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; color: #ffd36b;
  background: radial-gradient(circle at 50% 40%, #4a3a22, #1a1208 70%); border: 3px solid #8a6a2a; box-shadow: inset 0 0 0 3px #2a1d0e, inset 0 0 0 5px #c9a24b55, 0 4px 10px #000a; }
.set-ring img, .set-ring svg { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 3px #000); }
.set-l { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.3; }
.set-back { background: none; border: 0; color: #e0b252; font-weight: 800; font-size: 14px; padding: 2px 0 6px; }
.set-title { margin: 0 0 8px; }
/* the emblem and the calligraphic name «تاج الممالك» (login, loading and maintenance screens) */
/* the game's front: the battle for the crown fills the login / loading screen, alive — a slow push-in on the crown,
   the crown pulsing with light and embers drifting up. --W is the app column, --S the painted square (it covers the
   width and the top ~72% of the height); the crown sits at (33.5%, 13.5%) of the painting. */
.auth, .boot { --W: min(560px, 100vw); --S: max(var(--W), 72vh); position: relative; isolation: isolate; }
.auth::before, .boot::before { content: ''; position: fixed; top: 0; bottom: 0; left: max(0px, calc(50vw - 280px)); width: var(--W); z-index: -1; pointer-events: none;
  --cx: calc((var(--W) - var(--S)) * .38 + var(--S) * .335); --cy: calc(var(--S) * .135);
  background: linear-gradient(#0e0a0600 0, #0e0a0610 calc(var(--S) * .42), #0e0a06d8 calc(var(--S) * .78), #0e0a06 calc(var(--S) * .98)) 0 0 / 100% 100% no-repeat,
    url(/art/ui/splash.webp) calc((var(--W) - var(--S)) * .38) 0 / var(--S) var(--S) no-repeat, #0e0a06;
  transform-origin: var(--cx) var(--cy); animation: logoPush 18s ease-in-out infinite alternate; }
.auth::after, .boot::after { content: ''; position: fixed; z-index: -1; pointer-events: none; width: calc(var(--S) * .3); aspect-ratio: 1; border-radius: 50%;
  left: calc(max(0px, calc(50vw - 280px)) + (var(--W) - var(--S)) * .38 + var(--S) * .335); top: calc(var(--S) * .135);
  background: radial-gradient(circle, #fff6d0d0 0, #ffd56a88 22%, #ff9a2a33 45%, transparent 68%); mix-blend-mode: screen; animation: crownPulse 2.6s ease-in-out infinite; }
/* the old emblem box is now a see-through spacer over the painting that carries the drifting embers */
.auth .logo .crown, .boot .boot-crown { position: relative; width: 100%; height: calc(var(--S) * .5); margin: 0 auto; background: none; filter: none; animation: none; }
.boot .boot-crown { width: var(--W); }
.auth .logo .crown::before, .boot .boot-crown::before { content: ''; position: absolute; inset: 0 6%; pointer-events: none; mix-blend-mode: screen; opacity: .9;
  background-image: radial-gradient(circle, #ffd27a 0 1.6px, transparent 2.4px), radial-gradient(circle, #ff9a3a 0 1.2px, transparent 2px), radial-gradient(circle, #fff0b0 0 1px, transparent 1.8px);
  background-size: 90px 130px, 130px 170px, 70px 110px; background-position: 10px 0, 60px 40px, 30px 80px;
  -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 75%, transparent); mask-image: linear-gradient(transparent, #000 20%, #000 75%, transparent);
  animation: embers 7s linear infinite; }
.auth .logo p { text-shadow: 0 2px 4px #000, 0 0 12px #000; }
.auth .card { background: #120c07d9; backdrop-filter: blur(6px); }
@keyframes logoPush { 0% { transform: scale(1); } 100% { transform: scale(1.08); } }
@keyframes crownPulse { 0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(.9); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } }
@keyframes embers { from { background-position: 10px 0, 60px 40px, 30px 80px; } to { background-position: 30px -130px, 40px -130px, 45px -30px; } }
@media (prefers-reduced-motion: reduce) { .auth::before, .auth::after, .boot::before, .boot::after, .auth .logo .crown::before, .boot .boot-crown::before { animation: none; } }
.auth .logo h1, .boot h1 { font-family: var(--font-logo); font-weight: 400; font-size: 92px; line-height: .95; margin: 0 0 4px; padding: 0 6px; color: #c8182a;
  /* polished metal gold with a bright band, a dark engraved edge and a three-step raised depth */
  background: linear-gradient(180deg, #fffef0 0%, #fff0a8 22%, #ffd24a 42%, #d98e14 58%, #ffe9a0 72%, #e8a426 88%, #9a5a08 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.2px #4a2604; text-shadow: none;
  filter: drop-shadow(0 1px 0 #7a4408) drop-shadow(0 2px 0 #5a3004) drop-shadow(0 3px 0 #3a1e02) drop-shadow(0 8px 10px #000d) drop-shadow(0 0 20px #ffb02a40); }
.auth .logo p { font-family: var(--font-head); color: #e8d8b0; }

/* ---------- locked building sheet ---------- */
.lk-sheet .lk-hero { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: radial-gradient(ellipse at 50% 70%, #3a2a16, #120c07 75%); border: 1px solid #4a3720; overflow: hidden; }
.lk-sheet .lk-art { height: 100%; width: 100%; filter: grayscale(.85) brightness(.75); }
.lk-sheet .lk-art img { width: 100%; height: 100%; object-fit: contain; }
.lk-sheet .lk-badge { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; gap: 4px; align-items: center; padding: 3px 10px; border-radius: 999px; background: #000b; border: 1px solid #c08f2c; color: #ffe08a; font-weight: 800; font-size: 12px; }
.lk-sheet .lk-desc { margin: 10px 2px 6px; line-height: 1.7; }
.lk-sheet .lk-feat { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #1d3a24aa; border: 1px solid #2f6a3c; font-size: 13px; }
.lk-sheet .lk-req { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: linear-gradient(90deg, #2a1410, #120c07); border: 1px solid #6a2a22; }
.lk-sheet .lk-req .req-art { width: 44px; height: 40px; flex: none; } .lk-sheet .lk-req .req-art img { width: 100%; height: 100%; object-fit: contain; }
.lk-sheet .lk-req .no { color: #f05050; font-weight: 900; }
.lk-bar { height: 7px; margin-top: 5px; border-radius: 4px; background: #000a; overflow: hidden; }
.lk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c08f2c, #ffe08a); }
.lk-sheet > .btn.block { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lk-need { margin-top: 4px; font-size: 12px; font-weight: 800; color: #ff9a7a; display: flex; align-items: center; gap: 4px; }

/* ---------- resource card ---------- */
.rs-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: radial-gradient(ellipse at 20% 50%, #3a2a16, #140e08 80%); border: 1px solid #5a4426; }
.rs-big { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #000a; box-shadow: inset 0 0 0 2px #c08f2c; }
.rs-amt { font-size: 22px; font-weight: 900; color: #ffe08a; }
.rs-rate { display: flex; flex-direction: column; align-items: center; } .rs-rate b { font-size: 15px; }
.rs-way { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; background: linear-gradient(90deg, #22170d, #120c07); border: 1px solid #3a2a16; }
.rs-way .rs-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: #000a; }
.rs-way .btn { flex: none; min-width: 64px; }
.rs-uses { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-use { display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 999px; background: #2e2114; border: 1px solid #5a4426; font-size: 12px; font-weight: 700; }

/* ---------- game guide ---------- */
.gd { display: flex; flex-direction: column; gap: 8px; }
.gd-dots { display: flex; justify-content: center; gap: 6px; }
.gd-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 1px solid #c08f2c; background: #2e2114; }
.gd-dot.done { background: #8a6420; } .gd-dot.on { background: #ffe08a; width: 22px; border-radius: 5px; }
.gd-pic { height: 150px; display: flex; justify-content: center; align-items: center; border-radius: 12px; background: radial-gradient(ellipse at 50% 65%, #4a3420, #140e08 78%); border: 1px solid #4a3720; overflow: hidden; }
.gd-pic img { max-height: 100%; max-width: 100%; object-fit: contain; animation: gdPop .45s ease-out; }
@keyframes gdPop { from { transform: scale(.85) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.gd-t { text-align: center; color: #ffe08a; font-family: var(--font-head); margin: 4px 0 0; }
.gd-body p { margin: 4px 0; line-height: 1.7; }
.gd-pts { margin: 4px 0; padding-inline-start: 20px; line-height: 1.75; } .gd-pts li::marker { color: #e0b252; }
.gd-now { text-align: center; font-size: 14px; color: #e8e0c8; }
.gd-res { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gd-r { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; background: #1c140c; border: 1px solid #5a4426; color: inherit; font-size: 12px; }
.gd-grp { margin-top: 6px; } .gd-gt { font-weight: 900; color: #e0b252; font-size: 13px; margin: 6px 2px 4px; }
.gd-b { width: 100%; display: flex; gap: 8px; align-items: center; text-align: start; padding: 6px 8px; margin-bottom: 4px; border-radius: 8px; background: linear-gradient(90deg, #22170d, #120c07); border: 1px solid #3a2a16; color: inherit; }
.gd-b.locked .gd-bi { filter: grayscale(1) brightness(.6); }
.gd-bi { flex: none; width: 46px; height: 40px; display: grid; place-items: center; } .gd-bi img { width: 100%; height: 100%; object-fit: contain; }
.gd-bn { font-weight: 800; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.gd-bd { font-size: 11px; color: #a8a294; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gd-lv { padding: 0 6px; border-radius: 4px; background: #8a6420; color: #fff; font-size: 11px; }
.gd-lk { font-size: 11px; color: #ff9a7a; } .gd-nb { font-size: 11px; color: #8fd0a0; }
.gd-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.gd-nav .btn { min-width: 96px; } .gd-n { color: #a8a294; font-size: 13px; }
.gd-welcome p { font-size: 15px; line-height: 1.7; }
.idetail { flex-wrap: wrap; } .idetail > .chest-odds { flex: 1 1 100%; } .chest-odds .kv { font-size: 13px; }
/* timers over buildings: what is running (icon), time left, and for training how many troops */
.c3-lbl .tm { display: inline-flex; align-items: center; gap: 3px; }
.c3-lbl .tm b { font-weight: 800; }
.c3-lbl .tm .ti { font-style: normal; font-size: 10px; line-height: 1; filter: saturate(.8); }
.c3-lbl .tm .tn { font-style: normal; color: #ffe08a; font-weight: 700; opacity: .9; padding-inline-start: 2px; border-inline-start: 1px solid #c08f2c66; }

/* ---------- support centre ---------- */
.h2-help { display: flex; align-items: center; gap: 3px; height: 26px; padding: 0 8px 0 6px; border-radius: 13px; cursor: pointer; position: relative;
  background: linear-gradient(#2a5a3a, #163a24); border: 1px solid #7fd49a; color: #e8ffe8; font-size: 11.5px; font-weight: 800; box-shadow: 0 2px 6px #0008; }
.h2-help svg { width: 17px; height: 17px; }
.h2-help .rdot { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; font-style: normal; text-align: center; border-radius: 8px; background: #e0434f; color: #fff; padding: 0 3px; }
.sp { display: flex; flex-direction: column; gap: 8px; }
.sp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp-tabs button { position: relative; padding: 9px; border-radius: 10px; background: #1c140c; border: 1px solid #5a4426; color: #cfc6b0; font-weight: 800; font-family: inherit; }
.sp-tabs button.on { background: linear-gradient(#e8c063, #a87a24); color: #2a1c05; border-color: #ffe08a; }
.sp-tabs i { font-style: normal; font-size: 11px; margin-inline-start: 6px; padding: 0 6px; border-radius: 8px; background: #0006; }
.sp-dot { position: absolute; top: 6px; inset-inline-end: 8px; width: 9px; height: 9px; border-radius: 50%; background: #e0434f; }
.sp-hero { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: radial-gradient(ellipse at 15% 50%, #2a5a3a55, #140e08 75%); border: 1px solid #3a6a48; }
.sp-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-topic { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border-radius: 12px; text-align: center; color: inherit; font-family: inherit;
  background: linear-gradient(#24190f, #140e08); border: 1px solid #5a4426; }
.sp-topic:active { transform: scale(.97); }
.sp-topic b { font-size: 13px; } .sp-topic small { font-size: 11px; color: #a8a294; }
.sp-ti { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #000a; box-shadow: inset 0 0 0 2px #c08f2c; }
.sp-back { align-self: flex-start; background: none; border: 0; color: #ffe08a; font-weight: 800; font-family: inherit; font-size: 15px; padding: 2px 0; }
.sp-auto { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: #1d2a3a99; border: 1px solid #2f4a6a; font-size: 12px; color: #cfe0f6; }
.sp-list { display: flex; flex-direction: column; gap: 6px; }
.sp-row { display: flex; gap: 10px; align-items: center; text-align: start; padding: 10px; border-radius: 10px; background: linear-gradient(90deg, #22170d, #120c07); border: 1px solid #3a2a16; color: inherit; font-family: inherit; }
.sp-row.unread { border-color: #e0b252; box-shadow: 0 0 0 1px #e0b25244 inset; }
.sp-code { font-family: ui-monospace, monospace; font-size: 12px; color: #e0b252; direction: ltr; text-align: end; display: flex; gap: 6px; justify-content: flex-end; }
.sp-new { font-family: inherit; font-size: 10px; padding: 0 6px; border-radius: 6px; background: #e0434f; color: #fff; }
.sp-sub { font-weight: 800; }
.sp-st { flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #333; color: #ddd; white-space: nowrap; }
.sp-st.st-open { background: #2f4a6a; color: #cfe0f6; } .sp-st.st-in_review { background: #6a4a10; color: #ffe08a; } .sp-st.st-answered, .sp-st.st-pending { background: #1d5a34; color: #c8f5d4; }
.sp-st.st-resolved { background: #2a6a3a; color: #e8ffe8; } .sp-st.st-closed { background: #3a3a3a; color: #bbb; }
.sp-head { display: flex; gap: 10px; align-items: flex-start; }
.sp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0; }
.sp-steps div { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: #6f6a5f; }
.sp-steps i { width: 100%; height: 5px; border-radius: 3px; background: #2e2114; }
.sp-steps .on { color: #e0b252; } .sp-steps .on i { background: linear-gradient(90deg, #c08f2c, #ffe08a); }
.sp-thread { display: flex; flex-direction: column; gap: 8px; }
.sp-msg { max-width: 88%; padding: 8px 10px; border-radius: 12px; }
.sp-msg.me { align-self: flex-start; background: #2e2114; border: 1px solid #5a4426; border-end-start-radius: 3px; }
.sp-msg.staff { align-self: flex-end; background: #16301f; border: 1px solid #3a6a48; border-end-end-radius: 3px; }
.sp-who { display: flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 800; color: #e0b252; margin-bottom: 2px; } .sp-msg.staff .sp-who { color: #8ff0aa; }
.sp-who span { font-weight: 400; color: #8a8270; margin-inline-start: auto; }
.sp-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.sp-reply { border-top: 1px dashed #4a3720; padding-top: 8px; }
.sp-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sp-bigcode { font-family: ui-monospace, monospace; font-size: 28px; font-weight: 900; color: #ffe08a; letter-spacing: 2px; direction: ltr; padding: 6px 16px; border: 2px dashed #c08f2c; border-radius: 12px; margin-bottom: 6px; }
.sp-stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 12px; }
.sp-stars button { font-size: 30px; background: none; border: 0; color: #4a3720; cursor: pointer; } .sp-stars button.on { color: #ffd76e; }
/* screenshots */
.att { display: flex; flex-direction: column; gap: 4px; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; }
.att-th { position: relative; width: 64px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; border: 1px solid #5a4426; background: #0a0705; }
.att-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-th > button { position: absolute; top: 2px; inset-inline-end: 2px; width: 20px; height: 20px; line-height: 18px; padding: 0; border-radius: 50%; border: 0; background: #000b; color: #fff; font-size: 14px; }
.att-add { width: 64px; height: 64px; border-radius: 8px; border: 1px dashed #c08f2c; background: #1c140c; color: #e0b252; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: inherit; font-size: 11px; }
.att-add b { font-size: 20px; line-height: 1; }
.att-list.view { margin-top: 6px; } .att-list.view .att-th { width: 84px; height: 84px; cursor: zoom-in; }
.att-full { position: fixed; inset: 0; z-index: 9999; background: #000e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; }
.att-full img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: 6px; } .att-full span { color: #aaa; font-size: 12px; }

/* ---------- early account transfer ---------- */
.tr { display: flex; flex-direction: column; gap: 8px; }
.tr-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: radial-gradient(ellipse at 15% 50%, #3a2a16, #140e08 75%); border: 1px solid #5a4426; }
.tr-time { text-align: center; padding: 8px; border-radius: 10px; background: #2a1410; border: 1px solid #6a2a22; color: #ffd0c0; }
.tr-time b { color: #ffe08a; }
.tr-checks { display: flex; flex-direction: column; gap: 4px; }
.tr-c { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 8px; background: linear-gradient(90deg, #22170d, #120c07); border: 1px solid #3a2a16; font-size: 13px; }
.tr-c > span:first-child { font-weight: 900; width: 16px; text-align: center; } .tr-c.ok > span:first-child { color: #5fd17f; } .tr-c.no > span:first-child { color: #f05050; }
.tr-c small { color: #a8a294; }
.tr-list { display: flex; flex-direction: column; gap: 6px; }
.tr-k { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: #1c140c; border: 1px solid #5a4426; color: inherit; font-family: inherit; }
.tr-k.on { border-color: #ffe08a; box-shadow: 0 0 0 1px #ffe08a inset; background: #2e2114; }
.tr-k small { color: #a8a294; }

/* ---------- sign-in screen & accounts on this device ---------- */
.lg-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.lg-tabs button { flex: 1 1 auto; white-space: nowrap; padding: 8px 6px; border-radius: 9px; border: 1px solid #5a4426; background: #1c140c; color: #cfc6b0; font-weight: 800; font-family: inherit; font-size: 13px; }
.lg-tabs button.on { background: linear-gradient(#e8c063, #a87a24); color: #2a1c05; border-color: #ffe08a; }
.lg-link { display: block; margin: 10px auto 0; background: none; border: 0; color: #e0b252; text-decoration: underline; font-family: inherit; font-size: 13px; cursor: pointer; }
.lg-saved { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.lg-acc { display: flex; gap: 6px; align-items: center; }
.lg-pick { flex: 1; display: flex; gap: 10px; align-items: center; text-align: start; padding: 8px 10px; border-radius: 10px; background: linear-gradient(90deg, #2a1d10, #140e08); border: 1px solid #5a4426; color: inherit; font-family: inherit; cursor: pointer; }
.lg-pick small { display: block; color: #a8a294; font-size: 11px; }
.lg-av, .acc-av { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px #c08f2c; }
.lg-av svg, .lg-av img, .acc-av svg, .acc-av img { width: 100%; height: 100%; }
.lg-x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #6a2a22; background: #2a1410; color: #ff9a7a; font-size: 18px; cursor: pointer; }
.acc-row { display: flex; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px dashed #4a3720; }
.acc-row.cur b { color: #ffe08a; }
.mt-row { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px dashed #4a3720; }
.mt-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #000a; font-size: 18px; }
/* Google / Facebook buttons */
.sc-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; color: #a8a294; font-size: 12px; }
.sc-or::before, .sc-or::after { content: ''; flex: 1; height: 1px; background: #4a3720; }
.sc-gbox { display: flex; justify-content: center; min-height: 44px; margin-bottom: 8px; }
.sc-g, .sc-f { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; font-family: inherit; }
.sc-g { background: #fff; color: #222; border: 1px solid #ddd; } .sc-g b { color: #4285f4; font-size: 18px; }
.sc-f { background: #1877f2; color: #fff; border: 0; } .sc-f b { font-size: 18px; font-family: Arial, sans-serif; }
/* narrow phones: the support button shrinks to its icon so the name and power keep their room */
.pw-txt i, .pw-txt b { white-space: nowrap; }
.pw-txt b { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 420px) { .h2-help span { display: none; } .h2-help { padding: 0 5px; } }

/* ===================== top bar: portrait + resource strip + VIP / power / jewels plaques ===================== */
.hx { position: relative; display: flex; direction: ltr; align-items: flex-start; gap: 0; }
.hx::before { content: ''; position: absolute; left: -8px; right: -8px; top: -3px; height: 30px; background: linear-gradient(#2a221b, #16110c 70%, #0d0a07); border-bottom: 1px solid #6e5732; box-shadow: 0 2px 6px #000c; }
.hx-left { position: relative; z-index: 2; flex: none; width: 66px; display: flex; flex-direction: column; gap: 2px; }
.hx-av { position: relative; width: 66px; height: 66px; padding: 0; cursor: pointer; border-radius: 7px; border: 2px solid #4a3a26;
  background: #000; box-shadow: inset 0 0 0 2px #1a120a, 0 0 0 1px #000, 0 3px 8px #000c; }
.hx-av .av-img { position: absolute; inset: 2px; border-radius: 4px; overflow: hidden; background: #111; }
.hx-av .av-img svg { width: 100%; height: 100%; display: block; }
.hx-lv { position: absolute; left: -2px; bottom: -2px; z-index: 1; min-width: 24px; height: 24px; line-height: 21px; padding: 0 4px; border-radius: 12px; text-align: center;
  background: radial-gradient(#3a3a3a, #111 70%); border: 1.5px solid #e8e8e8; color: #fff; font: 800 12px/21px var(--font-head); box-shadow: 0 1px 3px #000; }
.hx-dot { position: absolute; top: -4px; right: -4px; z-index: 2; width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff6a5a, #c8160c 60%, #8a0a04); box-shadow: 0 0 0 1px #5a0602, 0 1px 3px #000a; }
.hx-bar { height: 6px; border-radius: 1px; background: #050505; border: 1px solid #3a3a3a; overflow: hidden; box-shadow: 0 1px 2px #000; }
.hx-bar i { display: block; height: 100%; }
.hx-bar.xp i { background: linear-gradient(#5a9cf0, #2a5ab8); }
.hx-bar.st i { background: linear-gradient(#a4e05a, #4e9a22); }
.hx-right { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-res { height: 27px; display: flex; direction: rtl; align-items: center; gap: 10px; padding: 0 4px; overflow: hidden; }
.hx-r { display: flex; direction: ltr; align-items: center; gap: 3px; padding: 0; border: 0; background: none; cursor: pointer; flex: none;
  color: #f1dfb4; font: 700 12.5px var(--font-head); text-shadow: 0 1px 2px #000; }
.hx-r svg { width: 21px; height: 21px; flex: none; filter: drop-shadow(0 1px 1px #000); }
.hx-r.full .num { color: #ffb35a; }
.hx-plaques { display: flex; align-items: stretch; height: 36px; margin-top: 1px; margin-left: -3px; filter: drop-shadow(0 3px 4px #000b); }
.hx-plaques > button { position: relative; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); }
.hx-vip { flex: none; width: 66px; color: #fff3d8; font-size: 15px; font-weight: 900; letter-spacing: .3px; text-shadow: 0 1px 0 #5a3410, 0 2px 3px #000a;
  background: linear-gradient(#e7c07a, #b78640 45%, #8c5e26 55%, #b0803c); border: 1.5px solid #5e3f18; border-radius: 4px 0 0 4px;
  box-shadow: inset 0 1px 0 #fff0c088, inset 0 0 0 2px #d8a95a55; }
.hx-vip.off { filter: grayscale(.9) brightness(.85); }
.hx-power { flex: 1; min-width: 0; color: #f6e8c4; font-size: 16px; font-weight: 800; text-shadow: 0 1px 2px #000;
  background: radial-gradient(ellipse at 50% 0%, #2f5a4a 0%, transparent 70%), repeating-linear-gradient(45deg, #ffffff06 0 6px, transparent 6px 12px), linear-gradient(#1e3d33, #12281f 60%, #0c1c16);
  border: 1.5px solid #8a6a36; border-left-width: 3px; border-right-width: 3px; border-left-color: #b08a48; border-right-color: #b08a48; border-radius: 10px 10px 2px 2px / 6px 6px 2px 2px;
  box-shadow: inset 0 0 0 1px #00000088, inset 0 -6px 10px #0006; }
.hx-gem { position: absolute; left: 50%; bottom: -5px; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); background: linear-gradient(135deg, #7ef0d8, #1a8a78); border: 1px solid #c8a060; box-shadow: 0 0 4px #4ee0c8aa; }
.hx-power::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 22px; height: 8px; transform: translateX(-50%); background: #12281f; border: 1.5px solid #8a6a36; border-top: 0; border-radius: 0 0 11px 11px; }
.hx-power .hx-gem { z-index: 1; bottom: -6px; }
.hx-gems { flex: none; min-width: 112px; gap: 4px; padding: 0 10px 0 4px !important; justify-content: space-between !important; color: #fff; font-size: 17px; font-weight: 900; text-shadow: 0 1px 2px #0a3a06, 0 0 4px #0008;
  background: radial-gradient(ellipse at 40% 20%, #b8f070aa, transparent 55%), linear-gradient(#5aa82e, #2e7a1a 50%, #1e5e10 52%, #3c8c22);
  border: 1.5px solid #8a6a36; border-radius: 0 4px 4px 0; box-shadow: inset 0 1px 0 #d8ffb088, inset 0 0 0 1px #0a3a0680; }
.hx-gems svg { width: 30px; height: 30px; flex: none; margin: -4px 0; filter: drop-shadow(0 1px 2px #000a); }
.hx-gems .hx-dot { top: -6px; right: -6px; }
.hx-chips { display: flex; direction: rtl; gap: 5px; align-items: center; margin-top: 8px; padding-inline-start: 2px; }
.hx-chips .hud-ic { width: 28px; height: 28px; }
.hx-chips .hud-ic svg { width: 19px; height: 19px; }
.hx-help .dot { left: auto; right: -5px; }
@media (max-width: 400px) {
  .hx-left { width: 58px; } .hx-av { width: 58px; height: 58px; }
  .hx-res { gap: 6px; } .hx-r { font-size: 11px; } .hx-r svg { width: 18px; height: 18px; }
  .hx-vip { width: 54px; font-size: 13px; } .hx-power { font-size: 14px; } .hx-gems { min-width: 96px; font-size: 15px; } .hx-gems svg { width: 26px; height: 26px; }
}

/* ---------- red alarm: an enemy march is coming to your castle or your troops ---------- */
.al-edge { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 95;
  box-shadow: inset 0 0 70px 22px rgba(225,18,18,.78), inset 0 0 0 3px rgba(255,60,40,.55); animation: alPulse 1.15s ease-in-out infinite; }
.al-edge.scout { box-shadow: inset 0 0 60px 16px rgba(240,140,20,.62), inset 0 0 0 2px rgba(255,170,60,.5); }
body.under-attack .al-edge { display: block; }
@keyframes alPulse { 0%, 100% { opacity: .42; } 50% { opacity: 1; } }
.al-bar { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 18px; border: 1.5px solid #ff8a7a; background: linear-gradient(#b3170f, #5e0905); color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 0 14px #ff2a1a99, 0 3px 8px #000a; cursor: pointer; white-space: nowrap; max-width: calc(100% - 32px); animation: alBar 1.15s ease-in-out infinite; }
.al-bar.scout { border-color: #ffc070; background: linear-gradient(#c06a10, #6a3404); box-shadow: 0 0 12px #ff9a2a88, 0 3px 8px #000a; }
.al-bar .al-ic { font-size: 15px; } .al-bar .al-t { overflow: hidden; text-overflow: ellipsis; } .al-bar .al-c { color: #ffe08a; } .al-bar .al-n:empty { display: none; }
.al-bar .al-n { background: #fff; color: #9a120a; border-radius: 9px; padding: 0 6px; font-size: 11px; }
@keyframes alBar { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
@media (prefers-reduced-motion: reduce) { .al-edge, .al-bar { animation: none; opacity: .85; } }
/* the ruler's crown on the portrait */
.hx-crown { position: absolute; top: -13px; left: 50%; width: 30px; height: 30px; transform: translateX(-50%) rotate(-8deg); background: url('/art/ui/ic_crown.webp') center / contain no-repeat;
  filter: drop-shadow(0 0 4px #ffd34a) drop-shadow(0 2px 2px #000); pointer-events: none; z-index: 2; }
.notice.gold { background: #3a2a10; border-color: var(--gold); color: #ffe8b0; }

/* ---------- القصر الملكي: the court banner and the official posts ---------- */
.th-court { position: relative; height: 230px; margin: -8px -8px 8px; overflow: hidden; border-bottom: 3px solid #6b4f28;
  background: radial-gradient(ellipse at 50% 85%, #f0b24a55, transparent 60%), linear-gradient(90deg, #5a0e0e 0, #8a1a14 9%, #3a1a0e 18%, #2a1a10 50%, #3a1a0e 82%, #8a1a14 91%, #5a0e0e 100%); }
.th-court::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, #0000001f 10px 12px); pointer-events: none; }
.thc-bg { position: absolute; inset: 18px 0 0; display: flex; justify-content: center; opacity: .55; }
.thc-bg img { height: 100%; filter: drop-shadow(0 6px 10px #000a); }
.thc-fire { position: absolute; bottom: 0; width: 26px; height: 64px; border-radius: 50% 50% 40% 40%; background: radial-gradient(ellipse at 50% 80%, #fff3b0, #ff9a2a 45%, #c0300a 70%, transparent 72%); filter: blur(1px); animation: thcFire .5s ease-in-out infinite alternate; }
.thc-fire.l { left: 14px; } .thc-fire.r { right: 14px; animation-delay: .25s; }
@keyframes thcFire { from { transform: scaleY(1); opacity: .85; } to { transform: scaleY(1.15) translateY(-2px); opacity: 1; } }
.thc-king { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 3px 16px; border-radius: 3px; white-space: nowrap;
  background: linear-gradient(90deg, transparent, #000000b0 15%, #000000b0 85%, transparent); color: #e8d8b0; font-weight: 700; font-size: 14px; }
.thc-king b { color: #ffe08a; }
.thc-lord { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; z-index: 0; }
.th-court::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, #5a0c0c 0, #8a1a14e0 6%, #8a1a1400 22%, #8a1a1400 78%, #8a1a14e0 94%, #5a0c0c 100%), linear-gradient(transparent 55%, #000000a0); }
.thc-fire { z-index: 2; }
.thc-av { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); width: 100px; height: 100px; border-radius: 8px; overflow: hidden; border: 3px solid #c99a3a; z-index: 1; }
.thc-av img, .thc-av svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.thc-plate { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 26px; white-space: nowrap;
  background: linear-gradient(90deg, transparent, #000000c0 18%, #000000c0 82%, transparent); }
.thc-plate b { font-family: var(--font-head); font-size: 20px; color: #ffcf6a; text-shadow: 0 2px 0 #5a2a00, 0 0 8px #ff9a2a88; }
.thc-plate span { font-size: 14px; font-weight: 800; color: #fff; }
.of-head { margin: 12px -4px 8px; padding: 7px; text-align: center; font-family: var(--font-head); font-size: 18px; color: #f3dfb0; text-shadow: 0 2px 0 #000;
  background: linear-gradient(90deg, transparent, #3a2a18 20%, #3a2a18 80%, transparent); }
.of-head.bad { color: #d8dce8; background: linear-gradient(90deg, transparent, #232a38 20%, #232a38 80%, transparent); }
.of-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; }
.of-card { display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
.of-frame { position: relative; width: 100%; aspect-ratio: 1 / 1.08; border-radius: 10px 10px 4px 4px; overflow: hidden;
  border: 3px solid #b8862e; background: radial-gradient(circle at 50% 35%, #6a3a1c, #2a140a); box-shadow: inset 0 0 0 2px #3a2208, 0 0 0 1px #000, 0 3px 6px #000a; }
.of-frame::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; box-shadow: inset 0 0 0 2px #ffe08a55; pointer-events: none; z-index: 2; }
.of-av { position: absolute; inset: 0; } .of-av img, .of-av svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.of-emb { position: absolute; inset: 12% 14% 26%; width: 72%; height: 62%; object-fit: contain; filter: drop-shadow(0 3px 4px #000c); }
.of-emb.txt { display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 30px; color: #ffe08a; }
.of-name { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10px 2px 3px; text-align: center; font-family: var(--font-head); font-size: 13px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 4px #000; background: linear-gradient(transparent, #000000d0 55%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-rib { position: relative; width: 108%; margin-top: -2px; padding: 4px 3px 5px; text-align: center; font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(#c0301e, #7a140c); border: 1px solid #ff8a6a66; clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); text-shadow: 0 1px 1px #000; }
.of-card:not(.held) .of-rib { color: #ffd6c8; font-weight: 600; }
.of-card.bad .of-frame { border-color: #5a6272; background: radial-gradient(circle at 50% 35%, #3a3e48, #15171c); box-shadow: inset 0 0 0 2px #22252c, 0 0 0 1px #000, 0 3px 6px #000a; }
.of-card.bad .of-frame::before { box-shadow: inset 0 0 0 2px #c8d0e033; }
.of-card.bad:not(.held) .of-emb, .of-card.bad .of-av { filter: grayscale(1) brightness(.85) contrast(1.1) drop-shadow(0 3px 4px #000c); }
.of-card.bad .of-rib { background: linear-gradient(#3a4458, #1c2230); border-color: #8a96b066; }
.of-card:active .of-frame { transform: scale(.97); }
.of-card.big { width: 46%; margin: 0 auto 10px; } .of-card.big .of-name { font-size: 16px; } .of-card.big .of-rib { font-size: 14px; }
@media (max-width: 380px) { .of-grid { gap: 6px 4px; } .of-name { font-size: 11px; } .of-rib { font-size: 10.5px; } }
/* «بيانات الأمير»: the title */
.ld-title { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 6px; }
.ld-tframe { width: 132px; height: 132px; padding: 10px; border-radius: 6px; cursor: pointer; border: 4px solid #8a6420; background: radial-gradient(circle, #4a2a14, #1a0e06);
  box-shadow: inset 0 0 0 2px #3a2208, inset 0 0 18px #000, 0 0 0 2px #000, 0 0 16px #ffc04a44; }
.ld-tframe img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px #000c); }
.ld-tframe.none img { filter: grayscale(.85) brightness(.6) drop-shadow(0 4px 6px #000c); }
.ld-tbtn { border: 0; background: none; color: #ffcf6a; font-family: var(--font-head); font-size: 17px; cursor: pointer; text-shadow: 0 2px 0 #000; }
.my-title { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.my-title .mt-crown img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 0 12px #ffc04a88); }
.my-title.none .mt-crown img { filter: grayscale(.85) brightness(.6); } .my-title.bad .mt-crown img { filter: grayscale(1) sepia(.4) hue-rotate(-30deg); }
.my-title .mt-name { font-family: var(--font-head); font-size: 22px; color: #ffe08a; } .my-title.bad .mt-name { color: #ff9a8a; } .my-title.none .mt-name { color: #c8bca0; }

/* the ruler grants a post from a castle */
.grant-who { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: #2a1c0e; border: 1px solid #6b4f28; }
.grant-who b { font-size: 15px; } .grant-who .th-av { width: 44px; height: 44px; }
.of-card.sm .of-name { font-size: 11.5px; } .of-card.sm .of-rib { font-size: 10.5px; }
.of-card:disabled { cursor: default; opacity: .55; } .of-card.mine:disabled { opacity: 1; } .of-card.mine .of-frame { border-color: #ffe08a; box-shadow: 0 0 10px #ffd34a; }
.gold-btn { background: linear-gradient(#f3d27a, #a8721a); color: #2a1804; font-weight: 800; }

/* minimap at the top right, right under the top bar; the marches list moves below it while it is shown */
.world .minimap { top: calc(var(--hud-b, 98px) + 2px); }
.world .mini-btn { top: calc(var(--hud-b, 98px) + 2px); inset-inline-start: 164px; }
.world.mini-on .march-dock { top: max(calc(var(--top-h, 0px) + 8px), calc(var(--hud-b, 98px) + 92px)); }
.game.on-world:has(.world.mini-on) .queue-bar { margin-inline-start: 196px; }   /* the timers sit beside the minimap (and its button), not under it */
.rb-v b { white-space: nowrap; }

/* the kingdom's flag and the sultan's decree */
.kflag { display: inline-block; vertical-align: middle; line-height: 1; font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; filter: drop-shadow(0 1px 2px #000a); }
.thc-flag, .ld-flag { display: inline-flex; vertical-align: middle; margin-inline-end: 6px; }
.kf-prev { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 10px; background: radial-gradient(circle, #3a2a14, #160f07); border: 1px solid #6b4f28; }
.kf-prev b { font-family: var(--font-head); font-size: 20px; color: #ffe08a; }
.kf-row { display: flex; flex-wrap: wrap; gap: 6px; }
.kf-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 6px; border: 1px solid #4a3418; background: #1a1208; color: #e8d8b0; cursor: pointer; }
.kf-opt.on { border-color: #ffe08a; box-shadow: 0 0 6px #ffd34a88; } .kf-opt small { font-size: 10px; }
.kf-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.kf-c { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #0008; cursor: pointer; }
.kf-c.on { border-color: #ffe08a; box-shadow: 0 0 0 2px #000, 0 0 8px #ffd34a; }

/* ---------- chat: parchment page, framed portraits, VIP plaques and framed bubbles ---------- */
.cm-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: -4px -6px 0; }
.cm-tab { padding: 10px 4px; border: 2px solid #4a3418; border-radius: 4px; background: linear-gradient(#2a1e10, #1a1208); color: #c8b48a; font-family: var(--font-head); font-size: 15px; cursor: pointer; }
.cm-tab.on { background: linear-gradient(#e8c46a, #9a6a1c); color: #2a1804; border-color: #ffe08a; box-shadow: inset 0 0 0 1px #fff4; }
.cm-list { background: radial-gradient(ellipse at 50% 30%, #efe3c4, #d6c39a 70%, #c4ad80) !important; gap: 14px; }
.cm { max-width: 94%; gap: 10px; }
.cm-av { position: relative; width: 62px; height: 62px; border-radius: 6px; border: 0; background: none; overflow: visible; padding: 4px;
  background: linear-gradient(135deg, #8a6a3a, #3a2a14); box-shadow: 0 2px 5px #0007, inset 0 0 0 1px #c8a868; }
.cm-avi { width: 100%; height: 100%; border-radius: 3px; overflow: hidden; background: #1a1208; }
.cm-avi img, .cm-avi svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm.t-noble .cm-av { background: linear-gradient(135deg, #e8f2ff, #8aa8c8 45%, #f4f8ff 55%, #6a88a8); box-shadow: 0 2px 6px #0007, 0 0 0 1px #4a6a8a; }
.cm.t-royal .cm-av { background: linear-gradient(135deg, #fff1b0, #c8901c 40%, #ffe08a 55%, #8a5a10); box-shadow: 0 2px 8px #0008, 0 0 0 1px #5a3a08, 0 0 10px #ffd34a66; }
.cm-crown { position: absolute; top: -14px; left: 50%; width: 26px; height: 26px; transform: translateX(-50%); background: url('/art/ui/ic_crown.webp') center / contain no-repeat; filter: drop-shadow(0 1px 2px #000); }
.cm-h { gap: 7px; margin-bottom: 4px; color: #3a2a14; }
.cm-h b { color: #2a1c0c; font-size: 14px; font-weight: 800; }
.cm-vip { background: none; padding: 0; border-radius: 0; font-family: var(--font-head); font-size: 17px; font-weight: 900; font-style: italic;
  background-image: linear-gradient(#fff2a8, #d49a1c 55%, #8a5a08); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: .4px #5a3a08; filter: drop-shadow(0 1px 0 #0005); }
.cm-text { position: relative; padding: 12px 16px 8px; border-radius: 8px; font-size: 15px; line-height: 1.55;
  background: #f4ead2; border: 2px solid #9a7a4a; color: #2a1c0c; box-shadow: 0 2px 5px #0005, inset 0 0 0 1px #fff8; }
.cm-msg { white-space: pre-wrap; word-break: break-word; }
.cm-text .cm-t { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; color: inherit; opacity: .7; direction: ltr; text-align: end; }
.cm.t-noble .cm-text { background: linear-gradient(#5f8fb8, #4a7aa2); border: 3px solid #e8eef8; color: #fff; box-shadow: 0 0 0 1px #3a5a7a, 0 3px 6px #0006; border-radius: 6px; }
.cm.t-royal .cm-text { background: linear-gradient(#123056, #0b2142); border: 3px solid #d8a83a; color: #fff; border-radius: 6px;
  box-shadow: 0 0 0 1px #5a3a08, inset 0 0 0 1px #ffe08a66, 0 3px 8px #0008; }
.cm.t-noble .cm-text::before, .cm.t-noble .cm-text::after, .cm.t-royal .cm-text::before, .cm.t-royal .cm-text::after {   /* corner studs */
  content: ''; position: absolute; width: 12px; height: 12px; transform: rotate(45deg); top: -7px; background: #e8eef8; border: 1px solid #3a5a7a; }
.cm.t-noble .cm-text::before, .cm.t-royal .cm-text::before { inset-inline-start: -7px; } .cm.t-noble .cm-text::after, .cm.t-royal .cm-text::after { inset-inline-end: -7px; }
.cm.t-royal .cm-text::before, .cm.t-royal .cm-text::after { background: linear-gradient(135deg, #fff1b0, #b8800c); border-color: #5a3a08; }
.cm.mine .cm-text { background: linear-gradient(#fbf4d4, #efe2b0); border: 2px solid #d8c07a; color: #2a1c0c; border-radius: 8px; box-shadow: 0 2px 5px #0004; }
.cm.mine .cm-text::before, .cm.mine .cm-text::after { display: none; }
.cm.mine .cm-h { justify-content: flex-start; }
.cm.sys .cm-b { background: linear-gradient(180deg, #3a2a10, #22180a); border-radius: 8px; padding: 6px 10px; }
.cm.sys .cm-text { background: none; border: 0; box-shadow: none; color: #ffe08a; padding: 2px 0; }
.cm.sys .cm-h b { color: #ffe08a; } .cm.sys .cm-t { color: #c8b48a; }
.cm-bar { background: linear-gradient(#3a2814, #1c140a); }
.cm-in { background: #f4ead2; color: #2a1c0c; border: 2px solid #9a7a4a; border-radius: 8px; }
.cm-in::placeholder { color: #6a5a3a; }
.cm-pm { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #f4ead2; border: 2px solid #9a7a4a; color: #2a1c0c; cursor: pointer; }
.cm-pm.unread { border-color: #c0392b; box-shadow: 0 0 0 1px #c0392b55; } .cm-pm b { font-size: 14px; }
.cm-pm-ic { font-size: 20px; } .cm-pm .cm-t { color: #6a5a3a; direction: ltr; }
.cm-text { min-width: 190px; }

.kf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; padding: 4px; margin-top: 6px; border-radius: 8px; background: #120c06; border: 1px solid #3a2a16; }
.kf-ct { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 6px; border: 1px solid #3a2a16; background: #1c140a; color: #e8d8b0; cursor: pointer; min-width: 0; }
.kf-ct small { font-size: 10.5px; line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kf-ct.on { border-color: #ffe08a; background: #3a2a10; box-shadow: 0 0 8px #ffd34a88; }

/* map search: monsters / resource fields, the type, the level, go */
.ms { display: flex; flex-direction: column; gap: 10px; }
.ms-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ms-tab { padding: 9px; border-radius: 6px; border: 2px solid #4a3418; background: linear-gradient(#2a1e10, #1a1208); color: #c8b48a; font-family: var(--font-head); font-size: 16px; cursor: pointer; }
.ms-tab.on { background: linear-gradient(#e8c46a, #9a6a1c); color: #2a1804; border-color: #ffe08a; }
.ms-types { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: none; }
.ms-type { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; padding: 0; border: 0; background: none; color: #e8d8b0; cursor: pointer; }
.ms-pic { width: 74px; height: 74px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #4a3a24, #1a1208); border: 3px solid #6b4f28; box-shadow: inset 0 0 10px #000; }
.ms-pic img { width: 92%; height: 92%; object-fit: contain; }
.ms-type.on .ms-pic { border-color: #ffe08a; box-shadow: 0 0 12px #ffd34a, inset 0 0 10px #000; }
.ms-type small { font-size: 11px; text-align: center; line-height: 1.2; }
.ms-name { text-align: center; font-family: var(--font-head); font-size: 19px; color: #ffe08a; }
.ms-lvl { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px; border-radius: 10px; background: #1a1208; border: 1px solid #3a2a16; }
.ms-lvl > span:first-child { font-weight: 800; }
.ms-lvl b { min-width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f4ead2; color: #2a1c0c; font-size: 22px; border: 3px solid #9a7a4a; }
.ms-step { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #8a6a2a; background: linear-gradient(#f0c070, #c0802a); color: #3a2008; font-size: 22px; font-weight: 900; cursor: pointer; }
.ms-step:disabled { opacity: .4; cursor: default; }
.ms-go { font-size: 18px; min-height: 50px; }

/* «الوحوش» mail: a short note */
.mn { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.mn-head { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; background: radial-gradient(circle at 20% 50%, #3a2a14, #160f07); border: 1px solid #6b4f28; }
.mn-pic { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 4px 6px #000c); }
.mn-name { font-family: var(--font-head); font-size: 18px; color: #ffe08a; }
.mn-st { font-size: 13px; color: #ffb3a8; margin-top: 4px; } .mn-st.win { color: #9be89b; }
.mn-rows { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; border: 1px solid #3a2a16; }
.mn-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; font-size: 15px; background: #1a1208; }
.mn-row:nth-child(even) { background: #22180c; } .mn-row b { font-size: 16px; }
.mn-lv { display: inline-block; margin-top: 4px; padding: 1px 10px; border-radius: 10px; background: #0d0906; border: 1px solid #8a6a2a; color: #ffe08a; font-size: 12px; font-weight: 800; }

/* ---- the gold ribbon: the kingdom's news, the events and the announcement scroll across it ---- */
.ann-bar { display: none !important; }
.rib { position: absolute; z-index: 46; top: calc(var(--top-h, 120px) + 84px); left: 50%; transform: translateX(-50%); width: min(calc(100% - 24px), 560px); height: 46px;
  pointer-events: auto; animation: rib-in .35s ease-out; }
@keyframes rib-in { from { opacity: 0; transform: translate(-50%, -8px); } }
.rib::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #1c120a00, #1c120af4 7%, #26180cfa 50%, #1c120af4 93%, #1c120a00);
  border-top: 2px solid; border-bottom: 2px solid; border-image: linear-gradient(90deg, #0000, #c89a42 12%, #ffe9a8 50%, #c89a42 88%, #0000) 1; box-shadow: 0 4px 14px #0008; }
.rib-orn { position: absolute; left: 50%; width: 150px; height: 24px; transform: translateX(-50%); background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20160%2026'%3E%3Cdefs%3E%3ClinearGradient%20id%3D'g'%20x1%3D'0'%20x2%3D'0'%20y1%3D'0'%20y2%3D'1'%3E%3Cstop%20offset%3D'0'%20stop-color%3D'%23fff2b8'%2F%3E%3Cstop%20offset%3D'.5'%20stop-color%3D'%23e2b44e'%2F%3E%3Cstop%20offset%3D'1'%20stop-color%3D'%238a5a14'%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20fill%3D'none'%20stroke%3D'url(%23g)'%20stroke-width%3D'2.2'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M10%2024%20H54%20C62%2024%2064%2016%2070%2012%20M150%2024%20H106%20C98%2024%2096%2016%2090%2012'%2F%3E%3Cpath%20d%3D'M70%2012%20C66%206%2058%206%2056%2012%20C55%2016%2060%2018%2062%2015%20M90%2012%20C94%206%20102%206%20104%2012%20C105%2016%20100%2018%2098%2015'%2F%3E%3Cpath%20d%3D'M66%2024%20C70%2018%2074%2014%2080%2010%20C86%2014%2090%2018%2094%2024'%2F%3E%3C%2Fg%3E%3Cpath%20d%3D'M80%200%20L86%208%20L80%2016%20L74%208%20Z'%20fill%3D'url(%23g)'%20stroke%3D'%235a3a0a'%20stroke-width%3D'1'%2F%3E%3Ccircle%20cx%3D'80'%20cy%3D'8'%20r%3D'2.2'%20fill%3D'%237a1a10'%2F%3E%3Ccircle%20cx%3D'42'%20cy%3D'24'%20r%3D'2'%20fill%3D'%23e2b44e'%2F%3E%3Ccircle%20cx%3D'118'%20cy%3D'24'%20r%3D'2'%20fill%3D'%23e2b44e'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; pointer-events: none; z-index: 2; }
.rib-orn.top { top: -20px; }
.rib-orn.bot { bottom: -20px; transform: translateX(-50%) scaleY(-1); }
.rib-win { position: absolute; inset: 0 44px 0 12px; overflow: hidden; -webkit-mask: linear-gradient(90deg, #0000, #000 6%, #000 94%, #0000); mask: linear-gradient(90deg, #0000, #000 6%, #000 94%, #0000); }
[dir=rtl] .rib-win { inset: 0 12px 0 44px; }
.rib-t { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: center; gap: 8px; white-space: nowrap; direction: rtl; will-change: transform;
  transform: translateX(-200%); font-size: 16px; font-weight: 700; color: #fff3d6; text-shadow: 0 1px 2px #000, 0 0 6px #000a; }
.rib-t .num, .rib-t b { color: #ffd65a; }
.rib-ic { font-style: normal; font-size: 18px; }
.rib.royal .rib-t { color: #ffe9a8; } .rib.event .rib-t { color: #fff3d6; } .rib.warn .rib-t { color: #ffc9a0; } .rib.gift .rib-t { color: #c8ffd2; }
.rib-x { position: absolute; z-index: 3; top: 50%; left: 6px; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; cursor: pointer;
  font-size: 24px; font-weight: 900; line-height: 1; color: #d8261c; text-shadow: 0 0 2px #ffd68a, 0 0 1px #ffd68a, 0 2px 3px #000; }
[dir=rtl] .rib-x { left: 6px; right: auto; }

/* ---- the march speed-up window ---- */
.sheet.hst-sheet { background: linear-gradient(#2c2824, #1c1916); }
.sheet.hst-sheet .sheet-body { padding: 0 0 18px; }
.hst-band { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 8px; margin-bottom: 4px; background: linear-gradient(#191613, #0e0c0a);
  border-top: 2px solid #3d352c; border-bottom: 2px solid #3d352c; box-shadow: inset 0 0 22px #000; }
.hst-orn { width: 58px; height: 58px; flex: none; display: grid; place-items: center; }
.hst-orn img, .hst-orn svg { width: 100%; height: 100%; object-fit: contain; filter: grayscale(.85) sepia(.35) brightness(.55) contrast(1.2) drop-shadow(0 2px 2px #000); }
.hst-orn.l img, .hst-orn.l svg { transform: scaleX(-1); }
.hst-band .hst-bar { flex: 1; margin: 0; height: 36px; border: 3px solid #b48e4c; border-radius: 3px; background: #0a1322; box-shadow: 0 0 0 2px #2a1e10, inset 0 3px 6px #000; }
.hst-band .hst-bar i { background: linear-gradient(#7ab8ff, #3a7ad8 45%, #1d4c9e); box-shadow: inset 0 1px 0 #ffffff66; }
.hst-band .hst-bar b { line-height: 30px; font-size: 19px; letter-spacing: 1px; }
.hst-sheet .hst-to { margin: 6px 0 4px; font-size: 12.5px; }
.hst-sheet .hst-row { gap: 14px; padding: 12px 14px 12px; border: 0; border-top: 1px solid #3c362f; border-bottom: 2px solid #141210; background: linear-gradient(#302b26, #25211d); }
.hst-sheet .hst-ic { width: 64px; height: 64px; margin-bottom: 18px; border: 2px solid #9a9aa6; border-radius: 3px; background: radial-gradient(circle at 50% 38%, #4a7ad0, #14285a 78%); box-shadow: 0 2px 4px #000a; }
.hst-sheet .hst-ic.adv { background: radial-gradient(circle at 50% 38%, #f0a04a, #6a2e08 78%); }
.hst-sheet .hst-n { bottom: -21px; font-size: 15px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.hst-sheet .hst-name { font-size: 18px; color: #d9ccb6; font-weight: 700; }
.hst-d { font-size: 12px; color: #a39783; margin-top: 3px; }
.hst-sheet .hst-use { flex: none; min-width: 124px; height: 46px; padding: 0 18px; border: 0; border-radius: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
  background: linear-gradient(#f0c46e, #c08430 48%, #8e5a18); box-shadow: inset 0 0 0 3px #ffe2a055, inset 0 -4px 6px #5a3408;
  font-family: var(--font-head); font-size: 18px; color: #fff6e0; text-shadow: 0 1px 2px #4a2804; }
.hst-sheet .hst-use.sec { background: linear-gradient(#8a7a64, #5e5040 48%, #423628); font-size: 15px; }
.hst-sheet .hst-use:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }

/* ---- the bag: names under the items, and a clear item window ---- */
.igrid.named { grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.icell { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.iname { font-size: 11.5px; line-height: 1.25; text-align: center; color: #e8d8b0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.5em; }
.ib { display: flex; flex-direction: column; gap: 10px; }
.ib-head { display: flex; align-items: center; gap: 14px; }
.ib-head .itile { width: 86px; flex: none; }
.ib-name { font-family: var(--font-head); font-size: 20px; color: #ffe08a; }
.ib-cat { display: inline-block; margin: 3px 0 4px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; background: #3a2a14; color: #e8c88a; border: 1px solid #6b4f28; }
.ib-box { padding: 10px 12px; border-radius: 10px; background: #1a1208; border: 1px solid #3a2a16; }
.ib-box > b { display: block; color: #ffd65a; font-size: 14px; margin-bottom: 4px; }
.ib-box p { margin: 0; font-size: 14px; line-height: 1.6; color: #eadcbc; }
.ib-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ib-acts .btn { width: 100%; justify-content: center; }
.ib-src { font-size: 13px; color: #c8b48a; padding: 0 4px; } .ib-src b { color: #e8d8b0; font-weight: 600; }
