/* ═══ UNDEAD REALMS — bright, chunky, readable over a 3D world ═══ */
@font-face { font-family: 'Lilita One'; src: url(fonts/lilita-one.woff2) format('woff2'); font-display: swap; }
.rm {
  --rm-ink: #160a24; --rm-glass: rgba(20, 12, 34, .78); --rm-glass2: rgba(32, 20, 52, .9); --rm-line: rgba(255,255,255,.14);
  --rm-lime: #b6ff3b; --rm-pink: #ff4fd8; --rm-gold: #ffd23a; --rm-cyan: #5ff2ff; --rm-text: #fff; --rm-dim: #d6c6f2;
  --rm-head: 'Lilita One', 'Rubik', system-ui, sans-serif;
  position: fixed; inset: 0; z-index: 90; overflow: hidden; overflow: clip; background: #1a1428; color: var(--rm-text); font-family: var(--font, 'Rubik'), system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none;
}
body.rm-open { overflow: hidden; }
body.rm-open .toasts { top: calc(118px + env(safe-area-inset-top)); bottom: auto; z-index: 120; }
.rm [hidden] { display: none !important; }
.rm-3d { position: absolute; inset: 0; }
.rm-canvas { display: block; width: 100% !important; height: 100% !important; outline: none; cursor: grab; }
.rm-canvas:active { cursor: grabbing; }
.rm-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.rm-labels > * { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }

/* loading */
.rm-loading { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: radial-gradient(circle at 50% 40%, #3a1f5a, #160a24 70%); transition: opacity .6s; }
.rm-loading.out { opacity: 0; pointer-events: none; }
.rm-loading b { font: 400 30px var(--rm-head); letter-spacing: .02em; }
.rm-loading small { color: var(--rm-dim); font-weight: 600; }
.rm-loading-crest { width: 96px; height: 96px; display: grid; place-items: center; font-size: 50px; border-radius: 28px; background: var(--rm-gold); border: 4px solid var(--rm-ink); box-shadow: 0 8px 0 var(--rm-ink); animation: rmBob 1.4s ease-in-out infinite; }
.rm-loading-bar { width: 220px; height: 10px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; }
.rm-loading-bar i { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rm-lime), var(--rm-cyan)); animation: rmLoad 1.2s ease-in-out infinite; }
@keyframes rmBob { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes rmLoad { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* top bar */
.rm-top { position: absolute; z-index: 5; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.rm-top > * { pointer-events: auto; }
.rm-spacer { flex: 1; pointer-events: none !important; }
.rm-back { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 3px solid var(--rm-ink); background: #fff; color: var(--rm-ink); font: 900 22px var(--font); cursor: pointer; box-shadow: 0 4px 0 var(--rm-ink); }
.rm-back:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rm-ink); }
.rm-id { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 18px; background: var(--rm-glass); border: 1px solid var(--rm-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 0; }
.rm-crest { --oc: var(--rm-lime); width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 13px; background: linear-gradient(160deg, color-mix(in srgb, var(--oc) 35%, #fff), var(--oc)); border: 3px solid var(--rm-ink); }
.rm-idtxt { display: grid; min-width: 0; }
.rm-name { all: unset; cursor: pointer; font: 400 21px/1.1 var(--rm-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.rm-name:not(:disabled)::after { content: ' ✎'; font-size: 13px; opacity: .55; }
.rm-sub { color: var(--rm-dim); font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.rm-res { display: flex; gap: 6px; }
.rm-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 6px; border-radius: 99px; background: var(--rm-glass); border: 1px solid var(--rm-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rm-chip .ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 15px; }
.rm-chip b { font: 800 15px var(--mono, monospace); letter-spacing: -.02em; }
.rm-builders.full { border-color: rgba(255,90,90,.6); } .rm-builders.full b { color: #ff9a9a; }

/* events */
.rm-events { position: absolute; z-index: 4; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 20px); }
.rm-ev { flex: none; } .rm-ev b, .rm-ev small { white-space: nowrap; }
.rm-ev { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 16px; color: var(--rm-ink); background: linear-gradient(135deg, #fff6c2, #ffd23a); border: 3px solid var(--rm-ink); box-shadow: 0 4px 0 var(--rm-ink); opacity: .82; }
.rm-ev.live { opacity: 1; animation: rmEv 2.4s ease-in-out infinite; }
.rm-ev.k-prod { background: linear-gradient(135deg, #eaffc2, #b6ff3b); } .rm-ev.k-speed { background: linear-gradient(135deg, #d6fbff, #5ff2ff); } .rm-ev.k-discount { background: linear-gradient(135deg, #ffe0f6, #ff8ae6); } .rm-ev.k-builder { background: linear-gradient(135deg, #fff0d6, #ffb02e); } .rm-ev.k-gift { background: linear-gradient(135deg, #f0e0ff, #c08bff); }
.rm-ev .ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #fff; font-size: 17px; border: 2px solid var(--rm-ink); }
.rm-ev b { display: block; font: 800 13px var(--font); } .rm-ev b em { font-style: normal; color: #6a1a8a; } .rm-ev small { font-weight: 700; font-size: 11px; opacity: .75; }
.rm-evbtn { border: 2px solid var(--rm-ink); background: var(--rm-ink); color: #fff; border-radius: 99px; padding: 6px 10px; font: 800 12px var(--font); cursor: pointer; }
@keyframes rmEv { 50% { transform: translateY(-2px); } }

/* dock */
.rm-dock { position: absolute; z-index: 6; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 7px; border-radius: 24px; background: var(--rm-glass2); border: 1px solid var(--rm-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 14px 40px rgba(0,0,0,.45); transition: transform .25s; }
.rm-dbtn { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 7px 8px 6px; border-radius: 17px; border: 0; background: transparent; color: #fff; cursor: pointer; font: 800 11.5px var(--font); }
.rm-dbtn .ic { font-size: 22px; line-height: 1; }
.rm-dbtn:hover { background: rgba(255,255,255,.08); }
.rm-dbtn.main { background: linear-gradient(180deg, #ffe066, #ffb02e); color: var(--rm-ink); border: 3px solid var(--rm-ink); box-shadow: 0 4px 0 var(--rm-ink); min-width: 74px; }
.rm-dbtn.main:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rm-ink); }
.rm-dbtn.glow .ic { animation: rmPulse 1.3s ease-in-out infinite; }
.rm-dbtn .badge { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--rm-pink); color: #fff; font: 900 10.5px/18px var(--font); font-style: normal; border: 2px solid var(--rm-ink); }
@keyframes rmPulse { 50% { transform: scale(1.18); } }
.rm.sheet-open .rm-dock { transform: translate(-50%, calc(100% + 30px)); }

/* labels */
.rm-tag { --oc: #ffb02e; display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; padding: 5px 10px 5px 8px; border-radius: 12px; border: 2px solid var(--rm-ink); background: rgba(255,255,255,.92); color: var(--rm-ink); cursor: pointer; box-shadow: 0 3px 0 var(--rm-ink); white-space: nowrap; font-family: var(--font); }
.rm-tag .dot { grid-row: span 2; width: 12px; height: 12px; border-radius: 50%; background: var(--oc); border: 2px solid var(--rm-ink); }
.rm-tag b { font: 800 12.5px var(--font); max-width: 160px; overflow: hidden; text-overflow: ellipsis; } .rm-tag small { font: 700 10.5px var(--font); opacity: .7; }
.rm-tag.mine { background: var(--rm-lime); }
.rm-tag::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--rm-ink); }
.rm-timer { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 12px; border: 2px solid var(--rm-ink); background: #fff; color: var(--rm-ink); cursor: pointer; position: relative; box-shadow: 0 3px 0 var(--rm-ink); font-family: var(--font); }
.rm-timer b { font: 800 12px var(--mono, monospace); }
.rm-timer .bar { position: absolute; left: 6px; right: 6px; bottom: -7px; height: 6px; border-radius: 99px; background: var(--rm-ink); overflow: hidden; }
.rm-timer .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--rm-lime), var(--rm-cyan)); }
.rm-bubble { display: flex; align-items: center; gap: 4px; padding: 4px 9px 4px 4px; border-radius: 99px; border: 2px solid var(--rm-ink); background: #fff; color: var(--rm-ink); cursor: pointer; box-shadow: 0 3px 0 var(--rm-ink); animation: rmBubble 1.8s ease-in-out infinite; font-family: var(--font); }
.rm-bubble .ic { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #fff3c4; font-size: 15px; }
.rm-bubble b { font: 800 12px var(--mono, monospace); }
.rm-bubble.full { background: var(--rm-gold); } .rm-bubble.full .ic { background: #fff; }
@keyframes rmBubble { 50% { margin-top: -5px; } }
.rm-float { position: absolute; transform: translate(-50%, -50%); font: 400 22px var(--rm-head); color: #fff; text-shadow: 0 3px 0 var(--rm-ink), 0 0 12px rgba(0,0,0,.5); pointer-events: none !important; animation: rmFloat 1.4s ease-out forwards; white-space: nowrap; }
.rm-float.gain { color: var(--rm-lime); } .rm-float.info { font: 800 13px var(--font); text-shadow: 0 2px 6px #000; }
@keyframes rmFloat { 0% { opacity: 0; margin-top: 10px; } 15% { opacity: 1; } 100% { opacity: 0; margin-top: -60px; } }

/* sheets */
.rm-sheet { position: absolute; z-index: 7; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(760px, calc(100% - 20px)); max-height: min(62vh, 560px); overflow: auto; padding: 14px; border-radius: 26px; background: linear-gradient(170deg, rgba(44, 26, 72, .97), rgba(22, 12, 38, .97)); border: 1px solid var(--rm-line); box-shadow: 0 -10px 50px rgba(0,0,0,.5); animation: rmUp .25s ease; touch-action: pan-y; -webkit-user-select: text; user-select: text; overscroll-behavior: contain; }
.rm-sheet.compact { width: min(560px, calc(100% - 20px)); }
@keyframes rmUp { from { transform: translate(-50%, 30px); opacity: 0; } }
.rm-shd { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rm-shd-t { flex: 1; min-width: 0; display: grid; } .rm-shd-t b { font: 400 24px/1.05 var(--rm-head); } .rm-shd-t small { color: var(--rm-dim); font-weight: 700; font-size: 12.5px; }
.rm-x { width: 38px; height: 38px; flex: none; border-radius: 12px; border: 0; background: rgba(255,255,255,.1); color: #fff; font: 900 16px var(--font); cursor: pointer; }
.rm-bic { --cc: var(--rm-lime); width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 14px; background: linear-gradient(160deg, #fff, color-mix(in srgb, var(--cc) 70%, #fff)); border: 3px solid var(--rm-ink); box-shadow: 0 3px 0 var(--rm-ink); }
.rm-bic.big { width: 54px; height: 54px; font-size: 30px; border-radius: 16px; }
.rm-desc { margin: 0 0 10px; color: var(--rm-dim); font-size: 14px; }
.rm-hint { display: block; color: var(--rm-dim); font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.rm-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rm-row.foot { padding-top: 10px; border-top: 1px solid var(--rm-line); }
.rm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 99px; border: 3px solid var(--rm-ink); background: #fff; color: var(--rm-ink); font: 900 14px var(--font); cursor: pointer; box-shadow: 0 4px 0 var(--rm-ink); }
.rm-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--rm-ink); }
.rm-btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.5); }
.rm-btn.primary { background: linear-gradient(180deg, #d4ff7a, var(--rm-lime)); }
.rm-btn.big { width: 100%; min-height: 50px; font-size: 16px; margin-top: 10px; }
.rm-btn.crystal { background: linear-gradient(180deg, #c8fbff, var(--rm-cyan)); }
.rm-btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); box-shadow: none; }
.rm-btn.ghost.danger { color: #ffb0b0; border-color: rgba(255,120,120,.4); }
.rm-btn.raid { background: linear-gradient(180deg, #ff8a9a, #ff4d6d); color: #fff; }
.rm-btn.tiny { min-height: 32px; padding: 0 10px; font-size: 12px; box-shadow: 0 2px 0 var(--rm-ink); border-width: 2px; }
.rm-btn.tiny.danger { background: #ffd0d0; }
.rm-costs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.rm-cost { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.12); font: 800 12px var(--mono, monospace); }
.rm-cost.short { background: rgba(255,77,109,.3); color: #ffc0c8; }
.rm-time { font: 800 12px var(--mono, monospace); color: var(--rm-dim); }

/* build menu */
.rm-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: none; }
.rm-tabs::-webkit-scrollbar { display: none; }
.rm-tab { --cc: #fff; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; font: 800 13px var(--font); }
.rm-tab.on { background: var(--cc); color: var(--rm-ink); border-color: var(--rm-ink); box-shadow: 0 3px 0 var(--rm-ink); }
.rm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.rm-card { --cc: var(--rm-lime); position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 10px; border-radius: 20px; border: 3px solid var(--rm-ink); background: #fff8ec; color: var(--rm-ink); cursor: pointer; box-shadow: 0 5px 0 var(--rm-ink); transition: transform .12s; font-family: var(--font); }
.rm-card:hover { transform: translateY(-3px); }
.rm-card-art { position: relative; height: 74px; display: grid; place-items: center; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #fff 0%, color-mix(in srgb, var(--cc) 75%, #fff) 70%); border: 2px solid var(--rm-ink); }
.rm-card-art .ic { font-size: 40px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.rm-card-art em { position: absolute; font: 900 10.5px var(--font); font-style: normal; padding: 2px 7px; border-radius: 99px; background: var(--rm-ink); color: #fff; }
.rm-card-art .cnt { top: 6px; right: 6px; } .rm-card-art .sz { bottom: 6px; left: 6px; background: rgba(22,10,36,.55); }
.rm-card-name { font: 400 18px/1.05 var(--rm-head); }
.rm-card-desc { color: #5a4870; font-size: 11.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.rm-card-stats { display: flex; flex-wrap: wrap; gap: 4px; } .rm-card-stats span { font: 800 10.5px var(--font); padding: 2px 6px; border-radius: 99px; background: rgba(22,10,36,.08); }
.rm-card .rm-cost { background: rgba(22,10,36,.08); } .rm-card .rm-cost.short { background: #ffd0d6; color: #a3102f; } .rm-card .rm-time { color: #6a5880; }
.rm-card-why { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); white-space: nowrap; font: 900 11px var(--font); padding: 4px 9px; border-radius: 99px; background: var(--rm-ink); color: #fff; }
.rm-card.locked, .rm-card.full { filter: saturate(.25); opacity: .72; } .rm-card.poor .rm-card-why { background: #a3102f; }

/* building / visit sheet */
.rm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.rm-stats.three { grid-template-columns: repeat(3, 1fr); }
.rm-stat { display: grid; gap: 1px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid var(--rm-line); }
.rm-stat span { font-size: 11.5px; font-weight: 700; color: var(--rm-dim); } .rm-stat b { font: 800 17px var(--mono, monospace); } .rm-stat em { font: 800 12px var(--mono, monospace); color: var(--rm-lime); font-style: normal; }
.rm-prod, .rm-upbox { padding: 12px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid var(--rm-line); margin-bottom: 10px; display: grid; gap: 8px; }
.rm-prod-t, .rm-up-hd { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.rm-prod-t b { font: 800 14px var(--mono, monospace); }
.rm-bar { height: 12px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.rm-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd23a, #b6ff3b); transition: width .3s; }
.rm-bar.up i { background: linear-gradient(90deg, #5ff2ff, #b06bff); }
.rm-maxed { padding: 12px; border-radius: 16px; text-align: center; font: 400 20px var(--rm-head); background: linear-gradient(135deg, #fff6c2, #ffd23a); color: var(--rm-ink); margin-bottom: 10px; }
.rm-catrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; } .rm-catrow span { --cc: #fff; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--cc) 22%, transparent); border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent); font-weight: 700; font-size: 12.5px; }
.rm-admin { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 16px; background: rgba(255,210,58,.12); border: 1px dashed rgba(255,210,58,.5); }
.rm-admin b { color: var(--rm-gold); margin-right: 4px; }

/* placing */
.rm-place { display: grid; gap: 8px; }
.rm-place-hd { display: flex; gap: 10px; align-items: center; } .rm-place-hd b { font: 400 20px var(--rm-head); }
.rm-place-why { margin: 0; font-weight: 700; font-size: 13px; color: var(--rm-lime); } .rm-place-why.bad { color: #ff9aa8; }
.rm-place-btns { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }

/* world list */
.rm-search { width: 100%; min-height: 42px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--rm-line); background: rgba(0,0,0,.3); color: #fff; font: 600 14px var(--font); margin-bottom: 8px; }
.rm-wlist { display: grid; gap: 6px; max-height: 38vh; overflow: auto; }
.rm-wrow { --oc: #fff; display: grid; grid-template-columns: 40px 14px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--rm-line); background: rgba(255,255,255,.05); color: #fff; text-align: left; cursor: pointer; font-family: var(--font); }
.rm-wrow:hover { background: rgba(255,255,255,.1); } .rm-wrow.me { background: rgba(182,255,59,.15); border-color: rgba(182,255,59,.5); }
.rm-wrow .rk { font: 800 13px var(--mono, monospace); color: var(--rm-dim); } .rm-wrow .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--oc); }
.rm-wrow b { display: block; font-weight: 800; } .rm-wrow small { color: var(--rm-dim); font-size: 12px; } .rm-wrow em { font: 800 13px var(--mono, monospace); font-style: normal; color: var(--rm-gold); }

/* help & welcome */
.rm-help { display: grid; gap: 8px; } .rm-help-it { display: flex; gap: 12px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.05); }
.rm-help-it > span { font-size: 26px; } .rm-help-it b { display: block; font: 400 17px var(--rm-head); } .rm-help-it small { color: var(--rm-dim); font-size: 13px; }
.rm-welcome { display: grid; gap: 14px; }
.rm-wel-hero { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, #2a1248, #3a1f5a); }
.rm-wel-hero > span { font-size: 46px; } .rm-wel-hero b { display: block; font: 400 24px var(--rm-head, 'Lilita One'); } .rm-wel-hero small { color: #d6c6f2; }
.rm-wel-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* phones */
@media (max-width: 760px) {
  .rm-top { flex-wrap: wrap; row-gap: 6px; }
  .rm-spacer { display: none; }
  .rm-id { flex: 1; }
  .rm-res { order: 5; width: 100%; justify-content: space-between; gap: 4px; }
  .rm-res .rm-chip { flex: 1; justify-content: center; }
  .rm-chip { height: 32px; padding: 0 9px 0 4px; } .rm-chip .ic { width: 24px; height: 24px; font-size: 13px; } .rm-chip b { font-size: 13px; }
  .rm-name { max-width: 50vw; font-size: 18px; } .rm-sub { max-width: 56vw; font-size: 11px; }
  .rm-events { top: calc(max(10px, env(safe-area-inset-top)) + 96px); left: 8px; right: 8px; transform: none; max-width: none; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .rm-events::-webkit-scrollbar { display: none; }
  .rm-ev { flex: none; padding: 4px 6px 4px 4px; } .rm-ev .ic { width: 24px; height: 24px; font-size: 14px; } .rm-ev b { font-size: 12px; }
  .rm-dock { width: calc(100% - 16px); justify-content: space-between; gap: 2px; padding: 6px; }
  .rm-dbtn { min-width: 0; flex: 1; padding: 6px 2px; font-size: 10.5px; } .rm-dbtn.main { min-width: 0; flex: 1.2; }
  .rm-sheet { width: calc(100% - 12px) !important; bottom: max(6px, env(safe-area-inset-bottom)); max-height: 66vh; padding: 12px; border-radius: 22px; }
  .rm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rm-card-desc { display: none; }
  .rm-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .rm-bubble, .rm-ev.live, .rm-dbtn.glow .ic, .rm-loading-crest { animation: none; } }
.realm-hud-btn { border-color: #5a3a8a !important; background: linear-gradient(180deg, rgba(176,107,255,.3), rgba(176,107,255,.08)) !important; color: #e6d0ff !important; }

/* gathering spots */
.rm-node { display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px; border-radius: 99px; border: 2px solid var(--rm-ink); background: linear-gradient(180deg, #fffbe8, #ffe48a); color: var(--rm-ink); cursor: pointer; box-shadow: 0 3px 0 var(--rm-ink); font-family: var(--font); animation: rmBubble 2.2s ease-in-out infinite; }
.rm-node .ic { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 14px; }
.rm-node b { font: 800 11px var(--mono, monospace); }
.rm-node.wait { background: rgba(255,255,255,.75); animation: none; opacity: .85; transform-origin: center; } .rm-node.wait .ic { filter: grayscale(1); }
.rm-r-energy .ic { background: rgba(182,255,59,.25); }

/* ── 3.3: level up, walking, live world events ── */
.rm-lvl { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.rm-lvl-rays { position: absolute; width: 160vmax; height: 160vmax; background: repeating-conic-gradient(from 0deg, rgba(255,210,58,.28) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 38%); mask: radial-gradient(circle, #000 0, transparent 38%); opacity: 0; }
.rm-lvl.go .rm-lvl-rays { animation: rmRays 2.6s ease-out forwards; }
.rm-lvl-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 28px 16px; border-radius: 26px; background: linear-gradient(170deg, #fff8d2, #ffd23a 70%); color: var(--rm-ink); border: 4px solid var(--rm-ink); box-shadow: 0 8px 0 var(--rm-ink), 0 0 60px rgba(255,210,58,.7); text-align: center; max-width: min(92vw, 440px); transform: scale(0); }
.rm-lvl-card.big { background: linear-gradient(170deg, #f4ffd8, #b6ff3b 70%); box-shadow: 0 8px 0 var(--rm-ink), 0 0 80px rgba(182,255,59,.8); }
.rm-lvl.go .rm-lvl-card { animation: rmPop 2.6s cubic-bezier(.2,1.6,.4,1) forwards; }
.rm-lvl-ic { font-size: 54px; line-height: 1; margin-top: -48px; filter: drop-shadow(0 4px 0 var(--rm-ink)); animation: rmBob 1s ease-in-out infinite; }
.rm-lvl-t { font: 400 clamp(34px, 9vw, 54px)/1 var(--rm-head); letter-spacing: .02em; color: #fff; -webkit-text-stroke: 3px var(--rm-ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--rm-ink); }
.rm-lvl-s { font-weight: 900; font-size: 17px; }
.rm-lvl-u { font-weight: 800; font-size: 13px; opacity: .85; }
.rm-conf { position: absolute; top: 46%; left: 50%; width: 10px; height: 16px; border-radius: 3px; background: var(--c); opacity: 0; animation: rmConf 2.2s cubic-bezier(.15,.7,.4,1) var(--d) forwards; }
@keyframes rmPop { 0% { transform: scale(0) rotate(-8deg); } 12% { transform: scale(1.12) rotate(2deg); } 20%, 82% { transform: scale(1) rotate(0); opacity: 1; } 100% { transform: scale(.85) translateY(-30px); opacity: 0; } }
@keyframes rmRays { 0% { opacity: 0; transform: rotate(0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: rotate(40deg) scale(1); } }
@keyframes rmConf { 0% { opacity: 1; transform: translate(-50%, 0) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), 55vh) rotate(var(--r)); } }

.rm-dbtn.on { background: var(--rm-lime); color: var(--rm-ink); }
.rm-joy { position: absolute; z-index: 6; left: max(18px, env(safe-area-inset-left)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 92px); width: 124px; height: 124px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(20,12,34,.55)); border: 3px solid rgba(255,255,255,.5); touch-action: none; display: grid; place-items: center; }
.rm-joy i { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(160deg, #fff, var(--rm-lime)); border: 3px solid var(--rm-ink); box-shadow: 0 4px 0 var(--rm-ink); pointer-events: none; }
.rm-prompt { position: absolute; z-index: 6; left: 0; top: 0; border: 3px solid var(--rm-ink); background: #fff; color: var(--rm-ink); border-radius: 99px; padding: 8px 14px; font: 900 14px var(--font); box-shadow: 0 4px 0 var(--rm-ink); cursor: pointer; white-space: nowrap; animation: rmBob 1.2s ease-in-out infinite; }
.rm.walking .rm-events { display: none; }

.rm-live { position: absolute; z-index: 5; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); width: min(94vw, 460px); padding: 10px 12px; border-radius: 20px; color: #fff; background: linear-gradient(160deg, rgba(70,10,40,.92), rgba(24,8,30,.92)); border: 3px solid var(--rm-ink); box-shadow: 0 5px 0 var(--rm-ink), 0 0 30px rgba(255,60,90,.45); display: grid; gap: 7px; }
.rm-live.treasure { background: linear-gradient(160deg, rgba(90,60,0,.92), rgba(30,18,6,.92)); box-shadow: 0 5px 0 var(--rm-ink), 0 0 30px rgba(255,210,58,.5); }
.rm.has-live .rm-events { top: calc(max(10px, env(safe-area-inset-top)) + 168px); }
.rm-live-hd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rm-live-hd .ic { font-size: 24px; animation: rmBob 1s ease-in-out infinite; }
.rm-live-hd b { font: 400 20px/1.1 var(--rm-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-live-hd small { margin-left: auto; font-weight: 800; color: #ffd8e4; white-space: nowrap; }
.rm-hp { position: relative; height: 20px; border-radius: 99px; background: rgba(0,0,0,.5); border: 2px solid var(--rm-ink); overflow: hidden; }
.rm-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff2d55, #ff7a45 60%, #ffd23a); transition: width .25s; box-shadow: inset 0 3px 0 rgba(255,255,255,.35); }
.rm-hp span { position: relative; display: block; text-align: center; font: 900 12px/16px var(--font); text-shadow: 0 1px 2px #000; }
.rm-live-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rm-live-row button { white-space: nowrap; flex: none; }
.rm-live-row small { font-weight: 700; color: #f2dcff; font-size: 12px; }
.rm-live.won .rm-hp i { background: var(--rm-lime); }
.rm-float.dmg { color: #fff; font: 400 26px var(--rm-head); -webkit-text-stroke: 2px #8a0020; paint-order: stroke fill; }
.rm-float.crit { color: #ffd23a; font: 400 36px var(--rm-head); -webkit-text-stroke: 3px var(--rm-ink); paint-order: stroke fill; }
.rm-float.gain { color: var(--rm-lime); font: 400 22px var(--rm-head); -webkit-text-stroke: 2px var(--rm-ink); paint-order: stroke fill; }
@media (max-width: 760px) { .rm-live { top: calc(max(10px, env(safe-area-inset-top)) + 96px); } .rm.has-live .rm-events { top: calc(max(10px, env(safe-area-inset-top)) + 196px); } }
@media (max-width: 560px) { .rm-live { padding: 8px 10px; } .rm-live-hd b { font-size: 17px; } .rm-joy { width: 112px; height: 112px; } }

/* ── 3.4: bell, hero, repairs, boss tags, knock-out ── */
.rm-bell { position: relative; flex: none; width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--rm-line); background: var(--rm-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-size: 19px; cursor: pointer; pointer-events: auto; display: grid; place-items: center; }
.rm-bell .badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--rm-pink); color: #fff; font: 900 10.5px/16px var(--font); font-style: normal; border: 2px solid var(--rm-ink); }
.rm-bell.ring .ic { animation: rmRing .9s ease; display: inline-block; transform-origin: 50% 10%; }
@keyframes rmRing { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
.rm-bellp { position: absolute; z-index: 40; top: calc(max(10px, env(safe-area-inset-top)) + 54px); right: 10px; width: min(92vw, 360px); max-height: min(60vh, 520px); display: flex; flex-direction: column; border-radius: 18px; background: var(--rm-glass2); border: 2px solid var(--rm-ink); box-shadow: 0 10px 30px rgba(0,0,0,.5); color: #fff; overflow: hidden; }
.rm-bellp-hd { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--rm-line); font: 400 17px var(--rm-head); }
.rm-bellp-hd .rm-x { width: auto; padding: 0 10px; font-size: 12px; }
.rm-bellp-list { overflow: auto; padding: 6px; display: grid; gap: 5px; }
.rm-note { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.06); }
.rm-note .ic { font-size: 17px; line-height: 1.2; } .rm-note p { margin: 0; font-weight: 700; font-size: 13px; line-height: 1.35; } .rm-note small { opacity: .6; font-weight: 800; font-size: 11px; }
.rm-note.k-warn { background: rgba(255,176,46,.12); } .rm-note.k-error { background: rgba(255,60,90,.16); } .rm-note.k-ok { background: rgba(182,255,59,.1); }
.rm-bellp-empty { padding: 18px; text-align: center; opacity: .75; font-weight: 700; margin: 0; }
.rm-peek { position: absolute; z-index: 39; top: calc(max(10px, env(safe-area-inset-top)) + 54px); right: 10px; max-width: min(80vw, 340px); padding: 8px 12px; border-radius: 14px; font: 800 13px var(--font); color: var(--rm-ink); background: #fff; border: 2px solid var(--rm-ink); box-shadow: 0 4px 0 var(--rm-ink); cursor: pointer; animation: rmPeek .25s ease; }
.rm-peek.k-error { background: #ffd0d8; } .rm-peek.k-warn { background: #fff0c8; }
@keyframes rmPeek { from { opacity: 0; transform: translateY(-6px); } }
.rm-hero { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.rm-hero .lv { flex: none; padding: 1px 7px; border-radius: 8px; background: var(--rm-gold); color: var(--rm-ink); font: 900 11px/16px var(--font); border: 1.5px solid var(--rm-ink); }
.rm-hero .hpb { position: relative; flex: 1; min-width: 90px; height: 14px; border-radius: 99px; background: rgba(0,0,0,.45); border: 1.5px solid var(--rm-ink); overflow: hidden; }
.rm-hero .hpb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff3a5a, #ff7a45 55%, #7dff8a); transition: width .4s; }
.rm-hero .hpb span { position: relative; display: block; text-align: center; font: 900 9.5px/11px var(--font); text-shadow: 0 1px 2px #000; }
.rm-hero.low .hpb { animation: rmLow 1s ease-in-out infinite; }
@keyframes rmLow { 50% { box-shadow: 0 0 0 3px rgba(255,60,90,.6); } }
.rm-fixall { pointer-events: auto; cursor: pointer; color: #fff; } .rm-fixall.bad { border-color: #ff5a5a; animation: rmLow 1.2s infinite; }
.rm-tag { position: relative; }
.rm-tag .hpl { grid-column: 2; display: flex; align-items: center; gap: 4px; }
.rm-tag .hpl em { font: 900 9.5px var(--font); font-style: normal; background: var(--rm-ink); color: var(--rm-gold); padding: 0 4px; border-radius: 5px; }
.rm-tag .hpb, .rm-fix .hpb, .rm-me .hpb, .rm-bosstag .hpb { display: block; position: relative; width: 56px; height: 6px; border-radius: 99px; background: rgba(0,0,0,.5); overflow: hidden; }
.rm-tag .hpb i, .rm-fix .hpb i, .rm-me .hpb i, .rm-bosstag .hpb i { position: absolute; inset: 0 auto 0 0; background: #4ade5a; }
.rm-tag .hpl.ko .hpb i { background: #ff3a5a; }
.rm-fix { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 2px; padding: 3px 6px; border-radius: 10px; border: 2px solid var(--rm-ink); background: #fff3c4; font-size: 15px; cursor: pointer; pointer-events: auto; }
.rm-fix .hpb i { background: #ffb02e; } .rm-fix.broken { background: #ffc4cc; animation: rmBob 1s ease-in-out infinite; } .rm-fix.broken .hpb i { background: #ff3a5a; }
.rm-me, .rm-bosstag { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 3px; padding: 3px 8px; border-radius: 10px; background: rgba(22,10,36,.82); border: 1.5px solid var(--rm-lime); color: #fff; pointer-events: none; white-space: nowrap; }
.rm-me b, .rm-bosstag b { font: 900 11px var(--font); } .rm-me.low .hpb i { background: #ff3a5a; }
.rm-bosstag { border-color: #ff3a5a; } .rm-bosstag .hpb { width: 90px; height: 7px; } .rm-bosstag .hpb i { background: linear-gradient(90deg, #ff2d55, #ffd23a); }
.rm-live .lvtag { font-style: normal; flex: none; background: #ff2d55; color: #fff; font: 900 11px/18px var(--font); padding: 0 7px; border-radius: 8px; border: 1.5px solid var(--rm-ink); }
.rm-live-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-top: 6px; border-top: 1px dashed rgba(255,255,255,.2); }
.rm.aiming .rm-canvas { cursor: crosshair; }
.rm-dmgbox { padding: 10px; border-radius: 14px; background: rgba(255,176,46,.12); border: 1.5px solid rgba(255,176,46,.5); display: grid; gap: 8px; }
.rm-dmgbox.broken { background: rgba(255,60,90,.14); border-color: rgba(255,60,90,.6); }
.rm-bar.hp i { background: linear-gradient(90deg, #ff3a5a, #ffb02e 60%, #7dff8a); }
.rm-hurt { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255,20,50,.55) 100%); }
.rm-hurt.go { animation: rmHurt .7s ease-out; }
@keyframes rmHurt { 0% { opacity: 1; } 100% { opacity: 0; } }
.rm.ko .rm-canvas { filter: grayscale(.7) brightness(.8); }
.rm-ko { position: absolute; z-index: 25; left: 50%; top: 42%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; padding: 14px 22px; border-radius: 20px; background: rgba(40,4,14,.88); border: 3px solid #ff3a5a; color: #fff; pointer-events: none; text-align: center; }
.rm-ko b { font: 400 28px var(--rm-head); } .rm-ko small { font-weight: 800; }
.rm-ev.sky { background: linear-gradient(135deg, #e9d8ff, #b98cff); }
.rm-ev.sky.k-bloodmoon, .rm-ev.sky.k-firerain { background: linear-gradient(135deg, #ffd0d0, #ff6a6a); } .rm-ev.sky.k-plague { background: linear-gradient(135deg, #e4ffd0, #8adf5a); } .rm-ev.sky.k-blizzard { background: linear-gradient(135deg, #ffffff, #bfe4ff); }
@media (max-width: 760px) { .rm-bell { width: 34px; height: 34px; font-size: 16px; border-radius: 12px; } .rm-hero .hpb { min-width: 70px; } .rm-bellp, .rm-peek { top: calc(max(10px, env(safe-area-inset-top)) + 96px); } }
@media (prefers-reduced-motion: reduce) { .rm-bell.ring .ic, .rm-fix.broken, .rm-hero.low .hpb, .rm-fixall.bad { animation: none; } }

/* sky events tint the whole screen a little, so you notice them even looking straight down */
.rm::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 2s; }
.rm[data-sky~="bloodmoon"]::after { opacity: 1; background: radial-gradient(ellipse at center, transparent 40%, rgba(160,0,20,.42) 100%); }
.rm[data-sky~="fire"]::after { opacity: 1; background: radial-gradient(ellipse at center, rgba(255,120,30,.08) 30%, rgba(200,50,0,.4) 100%); }
.rm[data-sky~="plague"]::after { opacity: 1; background: radial-gradient(ellipse at center, rgba(120,255,60,.06) 30%, rgba(60,140,20,.42) 100%); }
.rm[data-sky~="snow"]::after { opacity: 1; background: radial-gradient(ellipse at center, transparent 45%, rgba(235,245,255,.55) 100%); }
.rm[data-sky~="eclipse"]::after { opacity: 1; background: radial-gradient(ellipse at center, transparent 35%, rgba(20,0,40,.55) 100%); }
.rm[data-sky~="storm"]::after { opacity: 1; background: linear-gradient(rgba(30,40,60,.25), rgba(30,40,60,.1)); }
.rm[data-sky~="aurora"]::after, .rm[data-sky~="meteor"]::after { opacity: 1; background: radial-gradient(ellipse at top, rgba(80,255,190,.16), transparent 60%); }
.rm[data-sky~="harvestmoon"]::after { opacity: 1; background: radial-gradient(ellipse at center, transparent 45%, rgba(255,170,40,.28) 100%); }

/* ── 3.5: one column at the top (boss banner, then events) — nothing overlaps ── */
.rm-stack { position: absolute; z-index: 5; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); width: min(94vw, 520px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.rm-stack > * { pointer-events: auto; }
.rm-stack .rm-live, .rm-stack .rm-events { position: static; transform: none; left: auto; right: auto; top: auto; margin: 0; }
.rm-stack .rm-live { width: 100%; }
.rm-stack .rm-events { width: auto; max-width: 100%; }
.rm-live-hd b { min-width: 0; flex: 1; }
.rm-live-sub { display: flex; flex-wrap: wrap; gap: 6px; font: 800 11.5px var(--font); color: #f2dcff; }
.rm-live-sub .chip { padding: 1px 7px; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; }
.rm.sheet-open .rm-stack .rm-events { display: none; }
@media (max-width: 760px) { .rm-stack { top: calc(max(10px, env(safe-area-inset-top)) + 96px); width: calc(100% - 16px); } .rm-stack .rm-events { width: 100%; } }

/* skills */
.rm-skills { position: absolute; z-index: 6; right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 84px); display: flex; gap: 7px; padding: 6px; border-radius: 20px; background: rgba(20,12,34,.78); border: 1px solid var(--rm-line); transition: transform .25s, opacity .25s; }
.rm.sheet-open .rm-skills { opacity: 0; pointer-events: none; transform: translateY(20px); }
.rm-sk { position: relative; width: 58px; height: 58px; flex: none; border-radius: 16px; border: 3px solid var(--rm-ink); background: linear-gradient(160deg, #fff3c4, #ffb02e); box-shadow: 0 4px 0 var(--rm-ink); cursor: pointer; display: grid; place-items: center; overflow: hidden; padding: 0; }
.rm-sk:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rm-ink); }
.rm-sk .ic { font-size: 27px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); position: relative; z-index: 1; }
.rm-sk.k-heal { background: linear-gradient(160deg, #e4ffd8, #6ade5a); } .rm-sk.k-shield { background: linear-gradient(160deg, #e0fbff, #5ff2ff); } .rm-sk.k-curse { background: linear-gradient(160deg, #f0dcff, #b06bff); } .rm-sk.k-horde { background: linear-gradient(160deg, #eaffc2, #9be15d); }
.rm-sk .cd { position: absolute; inset: 0; z-index: 2; background: conic-gradient(rgba(22,10,36,.72) var(--k, 0deg), transparent 0); pointer-events: none; }
.rm-sk .t { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; color: #fff; font: 400 20px var(--rm-head); text-shadow: 0 2px 0 #000; pointer-events: none; }
.rm-sk .key { position: absolute; z-index: 3; left: 4px; top: 2px; font: 900 10px var(--font); font-style: normal; color: var(--rm-ink); opacity: .7; }
.rm-sk .nm { position: absolute; z-index: 3; left: 0; right: 0; bottom: 1px; font: 800 8.5px/1 var(--font); color: var(--rm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.rm-sk.locked { background: linear-gradient(160deg, #6a6278, #3a3248); } .rm-sk.locked .ic { filter: grayscale(1); opacity: .45; } .rm-sk.locked .nm { color: #cfc6e0; }
.rm-sk .lock { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; font: 900 11px var(--font); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
.rm-sk.idle:not(.cool) { filter: saturate(.55); }
.rm-sk:not(.cool):not(.locked):not(.idle) { border-color: #fff6c2; box-shadow: 0 4px 0 var(--rm-ink), 0 0 0 2px var(--rm-ink); }
@media (max-width: 760px) {
  .rm-skills { right: 8px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 80px); flex-direction: column-reverse; max-height: calc(100vh - 360px); overflow-y: auto; scrollbar-width: none; padding: 5px; gap: 6px; }
  .rm-sk { width: 50px; height: 50px; border-radius: 14px; } .rm-sk .ic { font-size: 23px; } .rm-sk .nm { display: none; }
}
.rm-float.big { font-size: 34px; }
.rm-bosscall { position: absolute; z-index: 24; left: 50%; top: 34%; transform: translateX(-50%); pointer-events: none; font: 400 clamp(30px, 7vw, 50px)/1 var(--rm-head); color: #fff; -webkit-text-stroke: 3px #5a0012; paint-order: stroke fill; text-shadow: 0 4px 0 #5a0012, 0 0 30px rgba(255,40,70,.8); white-space: nowrap; animation: rmCall 2.2s ease forwards; }
.rm-bosscall small { font-size: .5em; color: #7dff8a; }
.rm-bosscall.k-raise { text-shadow: 0 4px 0 #0a3a12, 0 0 30px rgba(120,255,140,.8); -webkit-text-stroke-color: #0a3a12; }
@keyframes rmCall { 0% { opacity: 0; transform: translateX(-50%) scale(.4); } 12% { opacity: 1; transform: translateX(-50%) scale(1.12); } 22%, 75% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px); } }
@media (prefers-reduced-motion: reduce) { .rm-sk, .rm-bosscall { animation: none !important; } }
.rm .rm-ev { position: relative; inset: auto; }

/* ── 3.6: what buildings do ── */
.rm-role { display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,210,58,.35); }
.rm-role-t { font: 400 17px var(--rm-head); color: var(--rm-gold); }
.rm-shop { display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.rm-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.22); }
.rm-item > .ic { width: 40px; height: 40px; display: grid; place-items: center; font-size: 24px; border-radius: 12px; background: rgba(255,255,255,.1); }
.rm-item b { font-weight: 900; font-size: 13.5px; } .rm-item small { display: block; opacity: .8; font-size: 12px; font-weight: 600; margin: 2px 0 4px; }
.rm-item.locked { opacity: .55; }
.rm-safe { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; font-weight: 800; }
.rm-num { width: 90px; height: 32px; border-radius: 10px; border: 2px solid var(--rm-ink); padding: 0 8px; font: 800 13px var(--font); }
.rm-hero.buffed .lv { box-shadow: 0 0 0 2px #ffb02e, 0 0 10px #ffb02e; }
.rm-r-bones b { color: #fff6e0; }
@media (max-width: 1100px) { .rm-r-bones { display: none; } }

/* ── 3.7: raids ── */
.rm-raidchip { pointer-events: auto; cursor: pointer; color: #fff; position: relative; }
.rm-raidchip.open { border-color: #b98cff; background: linear-gradient(135deg, rgba(60,30,110,.9), rgba(20,12,34,.9)); }
.rm-raidchip .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ff3a5a; color: #fff; font: 900 10px/14px var(--font); font-style: normal; border: 2px solid var(--rm-ink); }
.rm-raid { display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: linear-gradient(160deg, rgba(90,10,30,.5), rgba(30,8,30,.5)); border: 1.5px solid rgba(255,80,100,.45); }
.rm-raid-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; }
.rm-raid-vs > div { display: grid; gap: 2px; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.25); }
.rm-raid-vs small { opacity: .75; font-weight: 800; font-size: 11px; } .rm-raid-vs b { font: 400 22px var(--rm-head); } .rm-raid-vs em { font-style: normal; font-size: 11px; font-weight: 700; opacity: .85; }
.rm-raid-vs .vs { font: 400 22px var(--rm-head); color: #ff5a5a; }
.rm-raid-loot { display: grid; gap: 2px; } .rm-raid-loot small { opacity: .75; font-weight: 700; } .rm-raid-loot b { font-weight: 900; }
.rm-btn.raid.big { width: 100%; font-size: 16px; padding: 12px; }
.rm-skip { position: absolute; z-index: 26; right: 14px; top: calc(max(10px, env(safe-area-inset-top)) + 64px); }
.rm.raiding .rm-dock, .rm.raiding .rm-skills, .rm.raiding .rm-stack { opacity: 0; pointer-events: none; }
.rm-item.raidrow.def > .ic { background: rgba(255,60,90,.25); } .rm-item.raidrow.att > .ic { background: rgba(182,255,59,.2); }
.rm-dbtn.fix { background: linear-gradient(180deg, #7dff8a, #3ad06a); color: var(--rm-ink); border: 3px solid var(--rm-ink); box-shadow: 0 4px 0 var(--rm-ink); }
.rm-dbtn.fix.bad { background: linear-gradient(180deg, #ffd0d8, #ff5a6a); animation: rmLow 1.2s infinite; }
@media (max-width: 760px) { .rm-raidchip b { display: none; } }

/* ── 3.8: battles you play ── */
.rm.battling .rm-dock, .rm.battling .rm-skills, .rm.battling .rm-stack, .rm.battling .rm-top .rm-res, .rm.battling .rm-labels > :not(.rm-float) { display: none !important; }
.rm-battle { position: absolute; z-index: 20; top: calc(max(10px, env(safe-area-inset-top)) + 60px); left: 50%; transform: translateX(-50%); pointer-events: none; }
.rm-bt-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 18px; background: rgba(22,10,36,.86); border: 2px solid var(--rm-ink); color: #fff; pointer-events: auto; box-shadow: 0 4px 0 var(--rm-ink); }
.rm-bt-time { font: 400 20px var(--rm-head); min-width: 86px; } .rm-bt-pct { font: 400 24px var(--rm-head); color: var(--rm-gold); min-width: 54px; text-align: center; }
.rm-bt-stars span { font-size: 24px; color: #4a3a5a; -webkit-text-stroke: 1px #000; } .rm-bt-stars span.on { color: #ffd23a; text-shadow: 0 0 10px #ffb02e; }
.rm-bcards { position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); top: auto; bottom: max(12px, env(safe-area-inset-bottom)); height: auto; align-items: flex-end; display: flex; gap: 6px; padding: 7px; max-width: calc(100% - 16px); overflow-x: auto; border-radius: 22px; background: rgba(22,10,36,.86); border: 2px solid var(--rm-ink); scrollbar-width: none; }
.rm-bcard { position: relative; flex: none; width: 64px; height: 70px; min-height: 0; max-height: 70px; margin: 0; border-radius: 16px; border: 3px solid var(--rm-ink); background: linear-gradient(160deg, #fff3c4, #ffb02e); display: grid; place-items: center; padding: 2px 0 0; cursor: pointer; box-shadow: 0 4px 0 var(--rm-ink); }
.rm-bcard .ic { font-size: 30px; line-height: 1; } .rm-bcard b { font: 900 12px var(--font); color: var(--rm-ink); }
.rm-bcard.k-spell { background: linear-gradient(160deg, #f0dcff, #b06bff); } .rm-bcard.k-hero, .rm-bcard.k-ability { background: linear-gradient(160deg, #e4ffd8, #6ade5a); }
.rm-bcard.on { transform: translateY(-6px); box-shadow: 0 10px 0 var(--rm-ink), 0 0 0 3px #fff; } .rm-bcard.empty { filter: grayscale(1); opacity: .5; }
.rm-queue { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .rm-qi { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,.1); font-weight: 800; font-size: 12px; } .rm-qi .rm-x { width: 20px; height: 20px; font-size: 11px; }
@media (max-width: 760px) { .rm-battle { top: calc(max(10px, env(safe-area-inset-top)) + 100px); } .rm-bcard { width: 56px; height: 62px; } .rm-bcard .ic { font-size: 26px; } }

/* ── 3.9: movable boss banner, tidy repair marks, sponsored, profile strip ── */
.rm-stackbar { display: none; align-self: flex-end; gap: 4px; margin-bottom: -4px; }
.rm-stack:has(.rm-live:not([hidden])) .rm-stackbar { display: flex; }
.rm-stackbar button { width: 30px; height: 26px; border-radius: 9px; border: 2px solid var(--rm-ink); background: #fff6c2; color: var(--rm-ink); font: 800 15px/1 var(--font); cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 0 var(--rm-ink); }
.rm-stackbar .grip { cursor: grab; touch-action: none; } .rm-stackbar .grip:active { cursor: grabbing; }
.rm-stack.moved { width: min(94vw, 460px); }
.rm-stack.mini { width: auto; max-width: min(94vw, 340px); }
.rm-stack.mini .rm-live { padding: 6px 10px; gap: 4px; } .rm-stack.mini .rm-live > :not(.rm-live-hd):not(.rm-hp) { display: none; }
.rm-stack.mini .rm-live-hd b { font-size: 15px; } .rm-stack.mini .rm-events { display: none; }
@media (max-width: 760px) { .rm-stack.moved { width: calc(100% - 16px); } }

.rm-fix { display: block; padding: 0; gap: 0; border: 0; background: none; border-radius: 99px; }
.rm-fix span { display: none; }
.rm-fix .hpb { width: 34px; height: 4px; box-shadow: 0 0 0 1.5px rgba(26,10,40,.7); }
.rm-fix.broken { width: 26px; height: 26px; display: grid; place-items: center; background: #ff5a6e; border: 2px solid var(--rm-ink); box-shadow: 0 2px 0 var(--rm-ink); }
.rm-fix.broken span { display: block; font-size: 13px; line-height: 1; } .rm-fix.broken .hpb { display: none; }

.rm-ad { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border-radius: 16px; background: linear-gradient(135deg, #2a1046, #160a24); color: #fff; border: 2px solid #ffd23a; cursor: pointer; text-align: left; min-width: 0; }
.rm-ad img { width: 56px; height: 56px; object-fit: cover; border-radius: 11px; flex: none; background: #0004; }
.rm-ad .tx { min-width: 0; flex: 1; display: grid; gap: 1px; } .rm-ad em { font: 800 10px var(--font); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: #ffd23a; }
.rm-ad b { font: 800 14px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rm-ad small { font-size: 12px; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rm-ad .cta { flex: none; padding: 7px 11px; border-radius: 11px; background: #ffd23a; color: #160a24; font: 800 12px var(--font); }
.rm-ad:hover { filter: brightness(1.08); }
.rm-adimg { width: 100%; max-height: 260px; object-fit: cover; border-radius: 16px; border: 2px solid var(--rm-ink); }

.rm-prof { display: flex; align-items: center; gap: 10px; width: 100%; margin: 6px 0 10px; padding: 8px 10px; border-radius: 16px; border: 2px solid var(--rm-ink); background: linear-gradient(135deg, #f3e8ff, #e0f7ff); color: var(--rm-ink); cursor: pointer; text-align: left; box-shadow: 0 3px 0 var(--rm-ink); }
.rm-prof img, .rm-prof .noav { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rm-ink); flex: none; display: grid; place-items: center; background: #fff; font-size: 22px; }
.rm-prof > div { min-width: 0; flex: 1; display: grid; gap: 1px; } .rm-prof b { font: 800 15px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rm-prof b em { font-style: normal; font-weight: 700; color: #6a1a8a; }
.rm-prof small { font-size: 12px; font-weight: 700; opacity: .75; } .rm-prof .rs { color: #8a4a00; opacity: 1; } .rm-prof .go { font-size: 24px; font-weight: 800; }
.rm-hero { cursor: pointer; }
.rm-upall { width: 100%; margin-top: 8px; }
.rm-maxed { background: linear-gradient(135deg, #fff1a8, #ffc832); color: #5a3a00; }
.pc-realm { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgba(176,107,255,.12); border: 1px solid rgba(176,107,255,.4); margin: 6px 0; } .pc-realm span { font-size: 12px; opacity: .85; }
.rm-adminbtn { flex: none; width: 44px; height: 44px; border-radius: 14px; border: 3px solid var(--rm-ink); background: linear-gradient(135deg, #fff1a8, #ffc832); font-size: 20px; cursor: pointer; box-shadow: 0 3px 0 var(--rm-ink); display: grid; place-items: center; }
/* 3.10: fence, wood, trees */
.rm-buildx { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.rm-chipbtn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--rm-ink); background: #fff3c4; color: var(--rm-ink); font: 800 12px var(--font); cursor: pointer; box-shadow: 0 2px 0 var(--rm-ink); }
.rm-chipbtn.on { background: linear-gradient(135deg, #eaffc2, #b6ff3b); } .rm-chipbtn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); box-shadow: none; cursor: default; font-weight: 700; }
.rm-fence-styles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; } .rm-fence-styles > small { width: 100%; font-weight: 800; opacity: .8; }
.rm-cost.gain { background: linear-gradient(135deg, #eaffc2, #b6ff3b); color: var(--rm-ink); }
.rm-r-wood .ic { filter: saturate(1.2); }
/* the resource row has 7 chips now: on medium screens it goes under the name */
@media (min-width: 761px) and (max-width: 1240px) {
  .rm-top { flex-wrap: wrap; row-gap: 6px; } .rm-spacer { display: block; } .rm-id { flex: 0 1 auto; }
  .rm-res { order: 5; width: 100%; justify-content: flex-start; gap: 6px; }
  .rm-stack { top: calc(max(10px, env(safe-area-inset-top)) + 156px); }
}
/* 3.11: profile crest, realm level, chat */
.rm-crest.pic { padding: 0; overflow: hidden; cursor: pointer; } .rm-crest.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-crest { cursor: pointer; }
.rm-nameline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rm-xp { flex: none; display: grid; grid-template-columns: auto; justify-items: center; gap: 1px; padding: 2px 7px 3px; border-radius: 10px; border: 2px solid var(--rm-ink); background: linear-gradient(135deg, #fff1a8, #ffc832); color: var(--rm-ink); cursor: pointer; line-height: 1; }
.rm-xp b { font: 900 12px var(--font); } .rm-xp > i { display: block; width: 38px; height: 4px; border-radius: 9px; background: rgba(0,0,0,.25); overflow: hidden; } .rm-xp > i > i { display: block; height: 100%; background: #6a1a8a; }
.rm-xp span { display: none; }
.rm-chat { position: absolute; z-index: 30; right: 12px; bottom: 96px; top: calc(max(10px, env(safe-area-inset-top)) + 70px); width: min(380px, calc(100% - 24px)); display: flex; flex-direction: column; border-radius: 20px; background: rgba(20,12,34,.94); border: 3px solid var(--rm-ink); box-shadow: 0 6px 0 var(--rm-ink), 0 10px 40px rgba(0,0,0,.5); overflow: hidden; -webkit-user-select: text; user-select: text; touch-action: auto; }
.rm-chat header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: linear-gradient(135deg, #5a2a8a, #2a1046); } .rm-chat header b { font: 400 18px var(--rm-head); } .rm-chat header small { opacity: .7; font-size: 11px; flex: 1; }
.rm-chat header .x { width: 30px; height: 30px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.rm-chat-pin { padding: 8px 12px; background: rgba(255,210,58,.16); color: #ffe9a0; font-weight: 700; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.rm-chat-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.rm-chat-empty { opacity: .6; text-align: center; margin: auto; }
.rm-msg { display: flex; gap: 8px; align-items: flex-start; } .rm-msg .av { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: #2a1a3a; color: #fff; display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; font-size: 16px; } .rm-msg .av img { width: 100%; height: 100%; object-fit: cover; }
.rm-msg .bd { min-width: 0; flex: 1; padding: 6px 10px; border-radius: 4px 14px 14px 14px; background: rgba(255,255,255,.08); }
.rm-msg.me { flex-direction: row-reverse; } .rm-msg.me .bd { border-radius: 14px 4px 14px 14px; background: rgba(182,255,59,.16); }
.rm-msg.help .bd { background: rgba(255,90,90,.2); border: 1px solid rgba(255,120,120,.5); } .rm-msg.team .bd { background: rgba(255,210,58,.18); border: 1px solid rgba(255,210,58,.5); }
.rm-msg .hd { display: flex; align-items: center; gap: 6px; } .rm-msg .hd b { font-size: 12px; color: #ffd23a; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rm-msg .hd small { font-size: 10px; opacity: .55; }
.rm-msg .rep { margin-left: auto; border: 0; background: none; color: #fff; opacity: .35; cursor: pointer; font-size: 12px; } .rm-msg .rep:hover { opacity: .9; }
.rm-msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.35; word-break: break-word; white-space: pre-wrap; } .rm-msg .rm-btn { margin-top: 6px; }
.rm-chat-note { padding: 0 12px; font-size: 11px; opacity: .65; min-height: 0; }
.rm-chat-bar { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.rm-chat-in { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.35); color: #fff; font: 600 14px var(--font); }
.rm-chat-help, .rm-chat-send { flex: none; width: 42px; border-radius: 12px; border: 2px solid var(--rm-ink); cursor: pointer; font-size: 17px; }
.rm-chat-help { background: #3a2a4a; } .rm-chat-help.on { background: #ff5a6e; } .rm-chat-send { background: linear-gradient(135deg, #eaffc2, #b6ff3b); color: var(--rm-ink); font-weight: 900; }
@media (max-width: 760px) { .rm-chat { right: 8px; left: 8px; width: auto; top: auto; height: min(62vh, 520px); bottom: 86px; } }
/* chat: smaller by default, on the left (the skills are on the right), movable, resizable, can shrink */
.rm-chat { top: auto; height: min(52vh, 440px); width: min(340px, calc(100% - 24px)); resize: both; min-width: 260px; min-height: 200px; max-height: calc(100% - 120px); max-width: calc(100% - 16px); }
.rm-chat.left { right: auto; left: 12px; }
.rm-chat.moved { right: auto; bottom: auto; }
.rm-chat header { cursor: grab; touch-action: none; } .rm-chat header:active { cursor: grabbing; }
.rm-chat header .x + .x { margin-left: -2px; }
.rm-chat.mini { height: auto !important; min-height: 0; resize: none; } .rm-chat.mini > :not(header) { display: none; } .rm-chat.mini header small { display: none; }
.rm-fencebar { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 10px; border: 2px solid var(--rm-ink); background: rgba(20,12,34,.82); color: #fff; font: 800 11px var(--font); pointer-events: auto; cursor: pointer; white-space: nowrap; }
.rm-fencebar .hpb { display: block; position: relative; width: 70px; height: 6px; border-radius: 9px; background: rgba(255,255,255,.2); overflow: hidden; } .rm-fencebar .hpb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8fdcff, #c86aff); }
.rm-fencebar.hurt .hpb i { background: linear-gradient(90deg, #ffb02e, #ff5a6e); } .rm-fencebar.siege { background: rgba(120,10,30,.9); animation: rmBob 0.8s ease-in-out infinite; } .rm-fencebar.siege .hpb { width: 110px; } .rm-fencebar.siege .hpb i { background: #ff3a5a; }
@media (max-width: 760px) { .rm-chat, .rm-chat.left { left: 8px; right: 8px; width: auto; height: min(46vh, 400px); resize: none; } .rm-chat.moved { right: auto; } }
.rm-targets { display: grid; gap: 6px; margin: 8px 0 12px; } .rm-targets > b { font-weight: 800; }
.rm-targets .rm-wrow { cursor: default; } .rm-targets .rm-wrow .rm-btn { margin-left: auto; flex: none; }
.rm-btn.raid.go { background: linear-gradient(180deg, #d8ff6a, #4ade5a); color: var(--rm-ink); animation: rmGo 1.4s ease-in-out infinite; }
@keyframes rmGo { 0%, 100% { box-shadow: 0 4px 0 var(--rm-ink), 0 0 0 0 rgba(182,255,59,.6); } 50% { box-shadow: 0 4px 0 var(--rm-ink), 0 0 0 8px rgba(182,255,59,0); } }
.rm-btn.raid:disabled { background: #6a5a7a; color: #ddd; }
@media (prefers-reduced-motion: reduce) { .rm-btn.raid.go { animation: none; } }
/* who is online */
.rm-tag.online .dot { background: #4ade5a !important; box-shadow: 0 0 0 3px rgba(74,222,90,.35), 0 0 12px #4ade5a; animation: rmOnl 1.6s ease-in-out infinite; }
@keyframes rmOnl { 50% { box-shadow: 0 0 0 6px rgba(74,222,90,0), 0 0 16px #4ade5a; } }
.rm-wrow small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-onl { margin: 4px 0 8px; padding: 6px 10px; border-radius: 12px; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.08); color: #cfc6dc; } .rm-onl.on { background: rgba(74,222,90,.18); color: #b6ff9a; border: 1px solid rgba(74,222,90,.5); }
@media (prefers-reduced-motion: reduce) { .rm-tag.online .dot { animation: none; } }
/* 📜 battle log */
.rm-logbox { margin-top: 12px; display: grid; gap: 8px; } .rm-logbox h4 { margin: 0; font: 400 18px var(--rm-head); }
.rm-logsum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .rm-logsum > div { padding: 8px 10px; border-radius: 12px; } .rm-logsum small { display: block; font-size: 11px; opacity: .8; } .rm-logsum b { font-size: 13px; }
.rm-logsum .plus { background: rgba(74,222,90,.14); border: 1px solid rgba(74,222,90,.4); } .rm-logsum .minus { background: rgba(255,90,110,.14); border: 1px solid rgba(255,90,110,.4); }
.rm-log { display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.rm-logrow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.06); border-left: 4px solid #888; }
.rm-logrow.win { border-left-color: #4ade5a; } .rm-logrow.loss { border-left-color: #ff5a6e; } .rm-logrow .ic { font-size: 22px; flex: none; }
.rm-logrow .tx { min-width: 0; flex: 1; display: grid; gap: 2px; } .rm-logrow b { font-size: 14px; } .rm-logrow b em { font-style: normal; font-size: 11px; opacity: .8; } .rm-logrow.win b em { color: #7dff8a; } .rm-logrow.loss b em { color: #ff8a9a; }
.rm-logrow small { font-size: 11px; opacity: .75; } .rm-logrow .loot { font-weight: 800; font-size: 12px; } .rm-logrow .loot.plus { color: #9bff7a; } .rm-logrow .loot.minus { color: #ff9aa8; }
.rm-logrow .acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; flex: none; }
@media (max-width: 760px) { .rm-logrow { flex-wrap: wrap; } .rm-logrow .acts { width: 100%; justify-content: flex-start; } }
.rm-logrow .tx, .rm-logrow .loot { text-align: left; justify-self: start; }
/* 🗺 Crypt roadmap */
.rd-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.rd-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.rd-row .lv { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #2a1a3a; font: 900 14px var(--font); }
.rd-row.done { opacity: .55; } .rd-row.done .lv { background: #4ade5a; color: var(--rm-ink); } .rd-row.next { border-color: #ffd23a; background: rgba(255,210,58,.12); } .rd-row.next .lv { background: #ffd23a; color: var(--rm-ink); }
.rd-row small { display: block; font-size: 11px; opacity: .75; } .rd-items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .rd-items span { padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 12px; font-weight: 700; }
.rd-items .rd-new { background: rgba(182,255,59,.2); border: 1px solid rgba(182,255,59,.5); } .rd-army { margin-top: 4px; font-size: 12px; color: #ffd8a0; font-weight: 700; }
/* 📐 layouts */
.rm-lnow { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .rm-lnow small { display: block; font-size: 11px; opacity: .75; margin-bottom: 3px; }
.rm-lleg { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; font-weight: 700; } .rm-lleg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.rm-minimap { border-radius: 12px; border: 2px solid var(--rm-ink); image-rendering: pixelated; flex: none; display: grid; place-items: center; background: #2a1a3a; color: #aaa; font-size: 12px; width: 132px; height: 132px; }
.rm-lnow .rm-minimap { width: 110px; height: 110px; }
.rm-lcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.rm-lcard { display: flex; gap: 10px; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); } .rm-lcard > div:last-child { display: grid; gap: 4px; align-content: start; } .rm-lcard small { font-size: 12px; opacity: .8; }
.rm-lh { margin: 12px 0 6px; font: 400 17px var(--rm-head); } .rm-lslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rm-lslot { padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.2); display: grid; gap: 4px; } .rm-lslot small { font-size: 11px; opacity: .7; }
@media (max-width: 760px) { .rm-lcards { grid-template-columns: 1fr; } .rm-minimap { width: 104px; height: 104px; } }

/* ⚔ Army tab — the troops ready to fight, like Clash */
.rm-armytab { position: absolute; z-index: 5; left: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 92px); width: 188px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, rgba(58,26,104,.92), rgba(20,12,34,.92)); border: 2px solid #b98cff; box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.15); color: #fff; pointer-events: auto; transition: opacity .2s, transform .2s; }
.rm-armytab[hidden] { display: none; }
.rm-ahd { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: linear-gradient(90deg, #ffcf3a, #ff9f1c); color: #2a1206; font: 900 14px var(--font); }
.rm-ahd b { font-size: 16px; } .rm-ahd small { margin-left: auto; font-weight: 800; font-size: 12px; opacity: .85; }
.rm-ahd .car { font-style: normal; transition: transform .2s; } .rm-armytab.min .rm-ahd .car { transform: rotate(-90deg); }
.rm-armytab.min .rm-abody { display: none; }
.rm-abody { padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.rm-agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rm-acell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50px; border-radius: 11px; background: linear-gradient(180deg, #ffe9a8, #f4b947); border: 2px solid #fff3c4; box-shadow: 0 2px 0 #9a5a10; color: #2a1206; }
.rm-acell .ic { font-size: 22px; line-height: 1; } .rm-acell b { font: 900 12px var(--font); }
.rm-acell.ac-spell { background: linear-gradient(180deg, #e3c8ff, #a46bff); border-color: #f3e6ff; box-shadow: 0 2px 0 #5a2aa0; color: #1a0832; }
.rm-acell.ac-hero { background: linear-gradient(180deg, #b9ffd0, #3fd17a); border-color: #e6fff0; box-shadow: 0 2px 0 #1a7a40; color: #06301a; }
.rm-acell.ac-hero.ac-off { filter: grayscale(1); opacity: .7; }
.rm-aempty, .rm-atrain { font: 800 11px var(--font); color: #e6d8ff; text-align: center; }
.rm-atrain { color: #ffe08a; }
.rm.battling .rm-armytab, .rm.raiding .rm-armytab, .rm.walking .rm-armytab, .rm.sheet-open .rm-armytab { opacity: 0; pointer-events: none; transform: translateX(-20px); }
@media (max-width: 760px) { .rm-armytab { left: 8px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 84px); width: 150px; } .rm-acell { height: 42px; } .rm-acell .ic { font-size: 18px; } }

/* skills bar: open / close */
.rm-sktog { flex: none; align-self: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff3c4; background: linear-gradient(160deg, #ffe46b, #ffb21c); color: #2a1206; font: 900 15px var(--font); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 0 3px 0 var(--rm-ink); }
.rm-sktog .o { display: none; } .rm-skills.min .rm-sktog .o { display: block; font-size: 22px; } .rm-skills.min .rm-sktog .c { display: none; }
.rm-skills.min { padding: 4px; } .rm-skills.min .rm-sk { display: none; }
.rm-skills.min .rm-sktog { width: 52px; height: 52px; border-radius: 16px; }

/* 📣 admin message */
.rm-notice { position: absolute; z-index: 7; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 112px); width: min(92vw, 620px); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 16px; border: 3px solid var(--rm-ink); box-shadow: 0 5px 0 var(--rm-ink), 0 12px 26px rgba(0,0,0,.35); pointer-events: auto; color: #2a1206; animation: rmNoticeIn .5s cubic-bezier(.2,1.4,.4,1); }
.rm-notice[hidden] { display: none; }
.rm-notice.s-gold { background: linear-gradient(90deg, #fff3b0, #ffc53a); }
.rm-notice.s-red { background: linear-gradient(90deg, #ffd0d0, #ff5a6a); color: #3a0610; }
.rm-notice.s-purple { background: linear-gradient(90deg, #ecd8ff, #a76bff); color: #1c0838; }
.rm-notice.s-green { background: linear-gradient(90deg, #dcffe4, #45d97a); color: #06301a; }
.rm-notice.s-blue { background: linear-gradient(90deg, #d8f2ff, #4cb6ff); color: #06243a; }
.rm-notice .ic { font-size: 24px; flex: none; animation: rmNoticeBell 2.4s ease-in-out infinite; }
.rm-notice .mq { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; font: 800 15px var(--font); }
.rm-notice .tx { display: inline-block; }
.rm-notice .tx.roll { padding-left: 100%; animation: rmNoticeRoll var(--d, 12s) linear infinite; }
.rm-notice .x { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor; background: rgba(255,255,255,.45); color: inherit; font: 900 13px var(--font); cursor: pointer; }
@keyframes rmNoticeRoll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes rmNoticeIn { from { opacity: 0; transform: translate(-50%, -16px) scale(.9); } }
@keyframes rmNoticeBell { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
.rm.battling .rm-notice, .rm.sheet-open .rm-notice { display: none; }
.rm-noticepop { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10,4,20,.6); backdrop-filter: blur(3px); padding: 16px; }
.rm-noticepop .rm-npcard { width: min(92vw, 440px); text-align: center; padding: 22px 20px 18px; border-radius: 24px; border: 4px solid var(--rm-ink); box-shadow: 0 8px 0 var(--rm-ink); background: linear-gradient(160deg, #fff7d0, #ffc53a); color: #2a1206; animation: rmNoticeIn2 .5s cubic-bezier(.2,1.4,.4,1); }
.rm-noticepop.s-red .rm-npcard { background: linear-gradient(160deg, #ffe0e0, #ff6a78); } .rm-noticepop.s-purple .rm-npcard { background: linear-gradient(160deg, #f1e2ff, #b07cff); } .rm-noticepop.s-green .rm-npcard { background: linear-gradient(160deg, #e2ffe9, #5ce08a); } .rm-noticepop.s-blue .rm-npcard { background: linear-gradient(160deg, #e0f5ff, #66c2ff); }
.rm-noticepop .big { font-size: 54px; } .rm-noticepop h3 { margin: 4px 0 6px; font: 400 26px var(--rm-head, var(--font)); } .rm-noticepop p { font: 700 16px/1.45 var(--font); white-space: pre-wrap; margin: 0 0 14px; }
@keyframes rmNoticeIn2 { from { opacity: 0; transform: scale(.8); } }
@media (max-width: 760px) { .rm-notice { top: calc(max(10px, env(safe-area-inset-top)) + 148px); } .rm-notice .mq { font-size: 13px; } }
.rm-stack .rm-notice { position: relative; left: auto; top: auto; transform: none; width: 100%; animation: none; }
.rm-ev .rm-evline { display: block; font: 700 11px/1.2 var(--font); font-style: normal; opacity: .85; white-space: nowrap; }
@media (max-width: 760px) { .rm-ev .rm-evline { font-size: 10px; } }

/* 📣 Grand-Hall style announcement */
.rm-banner { z-index: 40; top: 40%; left: 0 !important; right: 0; margin: 0 auto; width: max-content; max-width: 88vw; transform: none !important; font-family: var(--rm-head, var(--font-display)); font-weight: 400; -webkit-text-stroke: 2px #2a1206; paint-order: stroke fill; }
.rm-banner.pop { animation: rmBannerIn .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes rmBannerIn { from { transform: translateY(30px) scale(.6) !important; opacity: 0; } }
.rm-annbox { position: absolute; z-index: 45; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 64px); width: min(92vw, 340px); padding: 12px; border-radius: 16px; background: rgba(28,14,24,.95); border: 1px solid rgba(255,190,90,.35); box-shadow: 0 12px 30px rgba(0,0,0,.5); color: #f3e3c8; pointer-events: auto; }
.rm-annbox[hidden] { display: none; }
.rm-annbox .eyebrow { font: 900 12px var(--font); letter-spacing: .18em; text-transform: uppercase; color: #f0a948; margin-bottom: 8px; }
.rm-annbox .row { display: flex; gap: 8px; }
.rm-annbox input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid #f0a948; background: rgba(0,0,0,.35); color: #fff; font: 600 14px var(--font); outline: none; }
.rm-annbox button { flex: none; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,190,90,.35); background: #5a2230; color: #fff; font: 800 14px var(--font); cursor: pointer; }
.rm-annbox .hint { margin: 8px 0 0; font: 600 12px var(--font); opacity: .85; }
.rm-annopt { margin-top: 8px; align-items: center; font: 700 12px var(--font); } .rm-annopt select { padding: 6px 8px; border-radius: 10px; background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,190,90,.35); font: 700 13px var(--font); }
.rm-banner.c-red { color: #ff6a6a; text-shadow: 0 0 30px rgba(255,60,60,.7), 0 4px 0 #000; } .rm-banner.c-purple { color: #d6a8ff; text-shadow: 0 0 30px rgba(170,90,255,.7), 0 4px 0 #000; }
.rm-banner.c-green { color: #8dffb0; text-shadow: 0 0 30px rgba(60,220,120,.7), 0 4px 0 #000; } .rm-banner.c-blue { color: #8fd4ff; text-shadow: 0 0 30px rgba(60,160,255,.7), 0 4px 0 #000; } .rm-banner.c-white { color: #fff; text-shadow: 0 0 30px rgba(255,255,255,.6), 0 4px 0 #000; }

/* 👷 builders menu */
.rm-builders { cursor: pointer; pointer-events: auto; color: inherit; font: inherit; background: linear-gradient(135deg, rgba(255,207,58,.22), rgba(20,12,34,.85)); border-color: rgba(255,207,58,.55); transition: transform .15s, box-shadow .15s; }
.rm-builders:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px rgba(255,207,58,.35); }
.rm-builders .car { font-style: normal; font-size: 10px; opacity: .8; margin-left: 2px; transition: transform .2s; } .rm-builders.open .car { transform: rotate(180deg); }
.rm-bldpanel { position: absolute; z-index: 30; top: calc(max(10px, env(safe-area-inset-top)) + 64px); right: 12px; width: min(94vw, 400px); max-height: min(72vh, 620px); overflow-y: auto; padding: 12px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(42,24,64,.97), rgba(22,12,34,.97)); border: 2px solid #ffcf3a; box-shadow: 0 16px 40px rgba(0,0,0,.55); color: #fff; pointer-events: auto; animation: rmBldIn .18s ease-out; scrollbar-width: thin; }
.rm-bldpanel[hidden] { display: none; }
@keyframes rmBldIn { from { opacity: 0; transform: translateY(-8px); } }
.rm-bld-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .rm-bld-hd b { font: 900 16px var(--font); } .rm-bld-hd small { flex: 1; color: #ffd76a; font: 700 12px var(--font); }
.rm-bld-sec { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; } .rm-bld-t { font: 800 11px var(--font); letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.rm-bld-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.rm-bld-tab { flex: 1; padding: 6px 8px; border-radius: 99px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font: 800 12px var(--font); cursor: pointer; white-space: nowrap; }
.rm-bld-tab.on { background: linear-gradient(180deg, #ffe46b, #ffb21c); color: #2a1206; border-color: #fff3c4; }
.rm-bld-list { display: flex; flex-direction: column; gap: 6px; }
.rm-bld-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); cursor: pointer; width: 100%; }
.rm-bld-row:hover { border-color: rgba(255,207,58,.6); } .rm-bld-row.ok { background: rgba(120,255,140,.08); border-color: rgba(120,255,140,.3); }
.rm-bld-row.work { background: rgba(255,207,58,.1); border-color: rgba(255,207,58,.35); }
.rm-bld-row .ic { font-size: 26px; flex: none; width: 34px; text-align: center; }
.rm-bld-row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .rm-bld-row .nm b { font: 800 14px var(--font); } .rm-bld-row .nm small { font: 600 11px var(--font); opacity: .8; }
.rm-bld-row .rm-costs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; } .rm-bld-row .tm { font: 800 12px var(--font); color: #ffd76a; flex: none; }
.rm-bld-foot { display: block; margin-top: 8px; opacity: .7; }
@media (max-width: 760px) { .rm-bldpanel { top: calc(max(10px, env(safe-area-inset-top)) + 100px); right: 8px; left: 8px; width: auto; } }
@media (max-width: 760px) { .rm-builders .car { display: none; } }

/* 📰 Realm ticker */
.rm-ticker { position: absolute; z-index: 6; top: 0; left: 0; right: 0; height: calc(26px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); display: flex; align-items: center; overflow: hidden; background: rgba(16,8,26,.92); border-bottom: 1px solid rgba(255,255,255,.14); box-shadow: 0 4px 14px rgba(0,0,0,.3); pointer-events: auto; }
.rm.has-ticker .rm-top, .rm.has-ticker .rm-stack, .rm.has-ticker .rm-bldpanel, .rm.has-ticker .rm-annbox, .rm.has-ticker > .rm-live, .rm.has-ticker > .rm-events { margin-top: 28px; }
.rm-ticker[hidden] { display: none; }
.rm-tk-live { flex: none; height: 100%; display: flex; align-items: center; gap: 5px; padding: 0 10px 0 12px; background: linear-gradient(90deg, #ff3a5a, #c81e4a); color: #fff; font: 900 10px var(--font); letter-spacing: .16em; }
.rm-tk-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: rmBlink 1.2s infinite; }
@keyframes rmBlink { 50% { opacity: .2; } }
.rm-tk-win { flex: 1; overflow: hidden; height: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.rm-tk-track { display: flex; width: max-content; height: 100%; animation: rmTicker linear infinite; } .rm-ticker:hover .rm-tk-track { animation-play-state: paused; }
@keyframes rmTicker { to { transform: translateX(-50%); } }
.rm-tk-row { display: flex; align-items: center; height: 100%; }
.rm-tk-item { display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; white-space: nowrap; font: 700 12px var(--font); color: #eadff8; border-right: 1px solid rgba(255,255,255,.1); }
.rm-tk-tag { font: 900 9px var(--font); letter-spacing: .08em; padding: 3px 7px; border-radius: 99px; color: #1a0a24; background: #cfc3e6; }
.rm-tk-item.k-sale .rm-tk-tag { background: linear-gradient(180deg, #8dffb0, #2fd47a); } .rm-tk-item.k-sale { color: #b8ffd0; }
.rm-tk-item.k-upgrade .rm-tk-tag { background: linear-gradient(180deg, #9fdcff, #3fa2ff); } .rm-tk-item.k-upgrade { color: #c4e8ff; }
.rm-tk-item.k-raid .rm-tk-tag { background: linear-gradient(180deg, #ff9aa8, #ff3a5a); color: #fff; } .rm-tk-item.k-raid { color: #ffc4cc; }
.rm-tk-item.k-title .rm-tk-tag { background: linear-gradient(180deg, #fff1a8, #ffc53a); box-shadow: 0 0 10px rgba(255,200,60,.7); } .rm-tk-item.k-title { color: #ffe39a; }
.rm-tk-item.k-boss .rm-tk-tag { background: linear-gradient(180deg, #e3c8ff, #9a5bff); color: #fff; } .rm-tk-item.k-boss { color: #e3ccff; }
.rm-tk-item.k-event .rm-tk-tag { background: linear-gradient(180deg, #ffe46b, #ffb21c); } .rm-tk-item.k-event { color: #ffe08a; }
.rm-tk-item.k-admin .rm-tk-tag { background: #fff; } .rm-tk-item.k-admin { color: #fff; }
.rm-tk-item.k-achievement .rm-tk-tag, .rm-tk-item.k-milestone .rm-tk-tag { background: linear-gradient(180deg, #c8ff9a, #7fd84a); }
@media (prefers-reduced-motion: reduce) { .rm-tk-track { animation: none; } .rm-tk-win { overflow-x: auto; } }
.rm.battling .rm-ticker { display: none; }

/* 👑 titles next to the name */
.rm-titles { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 1px; } .rm-titles[hidden] { display: none; }
.rm-atitle, .rm-rank { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; font: 800 10.5px var(--font); white-space: nowrap; }
.rm-atitle { color: var(--tc); background: rgba(0,0,0,.35); border: 1px solid var(--tc); }
.rm-rank.t1 { color: #e8eef6; background: linear-gradient(90deg, #5a6478, #8a95a8); border: 1px solid #c8d2e0; }
.rm-rank.t2 { color: #2a1206; background: linear-gradient(90deg, #ffd76a, #ffb21c); border: 1px solid #fff3c4; }
.rm-rank.t3 { color: #fff; background: linear-gradient(90deg, #c81e4a, #ff3a5a); border: 1px solid #ffb0bd; box-shadow: 0 0 8px rgba(255,60,90,.6); }
.rm-rank.t4 { color: #fff; background: linear-gradient(90deg, #6a2fff, #c46bff); border: 1px solid #e3c8ff; box-shadow: 0 0 10px rgba(170,90,255,.8); }
.rm-rank.t5 { color: #fff; background: linear-gradient(90deg, #ff3a5a, #ffb21c, #7dff8a, #3fb6ff, #c46bff, #ff3a5a); background-size: 300% 100%; border: 1px solid #fff; box-shadow: 0 0 14px rgba(255,220,120,.9); text-shadow: 0 1px 2px rgba(0,0,0,.6); animation: rmRankFlow 4s linear infinite; }
@keyframes rmRankFlow { to { background-position: 300% 0; } }
.rm-cryptgifts { margin: 10px 0; padding: 10px; border-radius: 14px; background: rgba(255,207,58,.08); border: 1px solid rgba(255,207,58,.35); display: flex; flex-direction: column; gap: 6px; }
.rm-cg-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .rm-cg-hd b { font: 900 14px var(--font); }
.rm-cg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 8px; border-radius: 10px; background: rgba(255,255,255,.04); }
.rm-cg-row .lv { font: 900 12px var(--font); min-width: 42px; color: #ffd76a; } .rm-cg-row .rm-costs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.rm-cg-row.next { background: rgba(120,255,140,.1); border: 1px solid rgba(120,255,140,.35); } .rm-cg-row.big .lv { color: #ff8fa0; }
.rm-cg-row .bonus { font: 800 10px var(--font); color: #ff8fa0; }

/* phones: the name card gets its own row, the buttons the next one, resources the third */
@media (max-width: 760px) {
  .rm-id { flex: 1 1 calc(100% - 56px); min-width: 0; }
  .rm-builders { margin-left: auto; }
  .rm-titles { gap: 3px; } .rm-atitle, .rm-rank { font-size: 9.5px; padding: 1px 6px; }
  .rm-stack { top: calc(max(10px, env(safe-area-inset-top)) + var(--rm-top-h, 196px)); }
  .rm-bldpanel { top: calc(max(10px, env(safe-area-inset-top)) + var(--rm-top-h, 196px)); }
}
.rm-bellp-hd { gap: 8px; } .rm-bellp-hd b { flex: 1; }
.rm.has-ticker .rm-bellp { margin-top: 28px; }
@media (max-width: 760px) { .rm-bellp { top: calc(max(10px, env(safe-area-inset-top)) + var(--rm-top-h, 196px)); } }
.rm-cneeds { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: rgba(255,90,110,.08); border: 1px solid rgba(255,90,110,.35); }
.rm-cneeds small { font: 800 11px var(--font); opacity: .85; }
.rm-cneed { display: flex; align-items: center; gap: 8px; font: 700 13px var(--font); } .rm-cneed b { flex: 1; font-weight: 700; } .rm-cneed em { font-style: normal; font-weight: 900; color: #ff8fa0; }
.rm-cneed.ok em { color: #7dff9a; } .rm-cneeds:not(:has(.rm-cneed:not(.ok))) { background: rgba(120,255,140,.08); border-color: rgba(120,255,140,.35); }

/* 📜 Quests */
.rm-dbtn.quest .ic { filter: drop-shadow(0 0 6px rgba(255,200,60,.6)); } .rm-dbtn.quest.glow { animation: rmQGlow 1.6s ease-in-out infinite; }
@keyframes rmQGlow { 50% { box-shadow: 0 0 0 3px rgba(255,200,60,.45), 0 0 18px rgba(255,200,60,.55); } }
.rm-qwrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 12px; min-height: 0; }
.rm-qlist { display: flex; flex-direction: column; gap: 4px; max-height: min(62vh, 560px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.rm-qch { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); position: relative; font: 700 13px var(--font); color: inherit; }
.rm-qch .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.1); font: 900 12px var(--font); flex: none; }
.rm-qch .ic { font-size: 18px; } .rm-qch .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-qch.on { background: linear-gradient(90deg, rgba(255,207,58,.25), rgba(255,207,58,.06)); border-color: rgba(255,207,58,.7); }
.rm-qch.done .n { background: #3fd17a; color: #06301a; } .rm-qch.ready .n { background: #ffcf3a; color: #2a1206; }
.rm-qch .badge { position: static; font-style: normal; min-width: 20px; height: 20px; border-radius: 99px; background: #ff3a5a; color: #fff; font: 900 11px/20px var(--font); text-align: center; padding: 0 5px; }
.rm-qch.locked { opacity: .55; cursor: default; }
.rm-qdetail { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rm-qhead { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,207,58,.18), rgba(176,107,255,.12)); border: 1px solid rgba(255,207,58,.4); }
.rm-qhead .big { font-size: 40px; } .rm-qhead > div { flex: 1; min-width: 0; } .rm-qhead small { font: 900 10px var(--font); letter-spacing: .16em; opacity: .75; } .rm-qhead h3 { margin: 2px 0 6px; font: 400 22px var(--rm-head, var(--font)); }
.rm-qtask { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.rm-qtask .ic { font-size: 24px; width: 32px; text-align: center; flex: none; } .rm-qtask .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rm-qtask .tx b { font: 800 13.5px var(--font); } .rm-qtask .tx small { font: 700 11px var(--font); opacity: .75; } .rm-qtask .rm-costs { display: flex; flex-wrap: wrap; gap: 4px; }
.rm-qtask .rm-bar { height: 6px; } .rm-qtask.ok { border-color: rgba(255,207,58,.6); background: rgba(255,207,58,.08); } .rm-qtask.claimed { opacity: .6; } .rm-qtask .done { font: 900 11px var(--font); color: #7dff9a; }
.rm-qbonus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(176,107,255,.1); border: 1px dashed rgba(176,107,255,.6); }
.rm-qbonus b { font: 900 14px var(--font); } .rm-qbonus small { flex-basis: 100%; opacity: .75; font: 600 12px var(--font); } .rm-qbonus .rm-costs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.rm-qbonus.ready { border-style: solid; border-color: #ffcf3a; background: rgba(255,207,58,.12); box-shadow: 0 0 18px rgba(255,207,58,.25); } .rm-qbonus.claimed { border-color: #3fd17a; background: rgba(60,210,120,.1); }
@media (max-width: 760px) { .rm-qwrap { grid-template-columns: 1fr; } .rm-qlist { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; } .rm-qch { flex: none; } .rm-qch .nm { max-width: 120px; } }
/* admin-uploaded thumbnails */
.rm-art { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: middle; display: inline-block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.rm-card-art .ic .rm-art { width: 64px; height: 64px; } .rm-bic .rm-art { width: 100%; height: 100%; padding: 3px; box-sizing: border-box; } .rm-item .ic .rm-art { width: 34px; height: 34px; } .rm-bld-row .ic .rm-art { width: 30px; height: 30px; } .rm-lvl-ic .rm-art { width: 1em; height: 1em; }

/* 📜 side quest tracker */
.rm-qtrack { position: absolute; z-index: 5; left: 12px; top: calc(max(10px, env(safe-area-inset-top)) + var(--rm-top-h, 150px) + 6px); width: 250px; border-radius: 16px; overflow: hidden; color: #fff; pointer-events: auto;
  background: linear-gradient(160deg, rgba(64,38,18,.93), rgba(26,14,30,.93)); border: 2px solid #ffcf3a; box-shadow: 0 8px 22px rgba(0,0,0,.4); transition: opacity .2s, transform .2s; }
.rm.has-ticker .rm-qtrack { margin-top: 28px; }
.rm-qtrack[hidden] { display: none; }
.rm-qt-hd { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; background: linear-gradient(90deg, rgba(255,207,58,.3), rgba(255,207,58,.08)); }
.rm-qt-hd .ic { font-size: 20px; } .rm-qt-hd .t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .rm-qt-hd small { font: 900 9px var(--font); letter-spacing: .14em; color: #ffd76a; } .rm-qt-hd b { font: 800 13px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-qt-hd .badge { position: static; font-style: normal; min-width: 20px; height: 20px; border-radius: 99px; background: #ff3a5a; color: #fff; font: 900 11px/20px var(--font); text-align: center; padding: 0 5px; animation: rmQGlow 1.6s ease-in-out infinite; }
.rm-qt-hd .car { font-style: normal; font-size: 11px; transition: transform .2s; } .rm-qtrack.min .rm-qt-hd .car { transform: rotate(-90deg); } .rm-qtrack.min .rm-qt-body { display: none; }
.rm-qtrack.min { width: auto; max-width: 250px; }
.rm-qt-body { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.rm-qt-task { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 10px; cursor: pointer; background: rgba(255,255,255,.05); }
.rm-qt-task:hover { background: rgba(255,255,255,.1); } .rm-qt-task.ok { background: rgba(255,207,58,.15); }
.rm-qt-task .ic { font-size: 16px; width: 20px; text-align: center; flex: none; } .rm-qt-task .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font: 700 11.5px/1.25 var(--font); }
.rm-qt-task .bar { display: block; height: 4px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; } .rm-qt-task .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf3a, #7dff8a); }
.rm-qt-task em { font-style: normal; font: 900 10.5px var(--font); color: #ffd76a; white-space: nowrap; }
.rm-qt-claim { width: 100%; margin-top: 2px; } .rm-qt-all { all: unset; cursor: pointer; text-align: center; font: 800 11px var(--font); color: #ffd76a; padding: 3px; }
.rm.battling .rm-qtrack, .rm.raiding .rm-qtrack, .rm.walking .rm-qtrack, .rm.sheet-open .rm-qtrack { opacity: 0; pointer-events: none; transform: translateX(-20px); }
@media (max-width: 760px) { .rm-qtrack { left: 8px; width: 210px; } }
@media (max-width: 760px) { .rm-qtrack { top: calc(max(10px, env(safe-area-inset-top)) + var(--rm-top-h, 196px) + 84px); } }
/* uploaded pictures always fit their box exactly (never bigger than the emoji they replace) */
.rm-art { max-width: 100%; max-height: 100%; object-fit: contain; }
.rm-bic, .rm-card-art .ic, .rm-item .ic, .rm-bld-row .ic, .rm-qtask .ic, .rm-lvl-ic { overflow: hidden; }
.rm-bic > .rm-art { width: 100% !important; height: 100% !important; padding: 3px; box-sizing: border-box; }
.rm-card-art .ic { display: grid; place-items: center; width: 72px; height: 72px; } .rm-card-art .ic > .rm-art { width: 64px !important; height: 64px !important; }
.rm-item .ic { display: grid; place-items: center; } .rm-item .ic > .rm-art { width: 36px !important; height: 36px !important; }
.rm-bld-row .ic > .rm-art { width: 30px !important; height: 30px !important; }
.rm-lvl-ic { display: inline-grid; place-items: center; } .rm-lvl-ic > .rm-art { width: 64px !important; height: 64px !important; }

/* ── 3.26: one tidy side column — the event banner, the quest tracker and the army stack under the name card and never cover each other ── */
.rm-side { position: absolute; z-index: 5; left: 12px; top: calc(max(10px, env(safe-area-inset-top)) + var(--rm-top-h, 120px) + 4px);
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 92px); width: 290px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; overflow: hidden auto; scrollbar-width: none; }
.rm-side::-webkit-scrollbar { display: none; }
.rm.has-ticker .rm-side { margin-top: 28px; }
.rm-side > * { pointer-events: auto; flex: none; }
.rm-side > .rm-stack, .rm-side > .rm-qtrack, .rm-side > .rm-armytab { position: relative !important; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important; transform: none !important; margin: 0 !important; width: 100% !important; max-width: none !important; }
.rm-side > .rm-stack { align-items: stretch; }
.rm-side > .rm-stack:not(:has(> :not(.rm-stackbar):not([hidden]))) { display: none; }
.rm-side .rm-stack .rm-stackbar .grip { display: none; }
.rm-side .rm-stack .rm-live { width: 100%; box-sizing: border-box; }
.rm-side .rm-stack .rm-events { width: 100%; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; overflow: visible; padding: 0; }
.rm-side .rm-ev { width: 100%; box-sizing: border-box; border-width: 2px; border-radius: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.rm-side .rm-ev b, .rm-side .rm-ev small, .rm-side .rm-ev .rm-evline { white-space: normal; }
.rm-side > .rm-armytab { margin-top: auto !important; }
.rm-side > .rm-qtrack.min, .rm-side > .rm-armytab.min { width: 100% !important; }
.rm.battling .rm-side, .rm.raiding .rm-side, .rm.walking .rm-side, .rm.sheet-open .rm-side { opacity: 0; pointer-events: none; }
.rm.battling .rm-side > *, .rm.raiding .rm-side > *, .rm.walking .rm-side > *, .rm.sheet-open .rm-side > * { pointer-events: none; }

/* phones: everything becomes a row of small chips under the top bar; tap one to open it */
@media (max-width: 760px) {
  .rm-side { left: 8px; right: 8px; width: auto; bottom: auto; max-height: 52vh; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
  .rm-side > .rm-stack, .rm-side > .rm-qtrack, .rm-side > .rm-armytab { width: auto !important; flex: 0 1 auto; }
  .rm-side > .rm-armytab { margin-top: 0 !important; }
  .rm-side > .rm-stack:not(.mini), .rm-side > .rm-qtrack:not(.min), .rm-side > .rm-armytab:not(.min) { flex: 1 1 100%; width: 100% !important; }
  .rm-side > .rm-stack.mini { max-width: 100%; }
  .rm-side .rm-stack.mini .rm-live { padding: 5px 9px; border-radius: 14px; }
  .rm-side .rm-stack.mini .rm-live-hd b { font-size: 13px; } .rm-side .rm-stack.mini .rm-live-hd small { font-size: 11px; }
  .rm-side .rm-stack.mini .rm-events { display: flex; flex-direction: row; gap: 4px; }
  .rm-side .rm-stack.mini .rm-ev { width: auto; padding: 3px; border-radius: 12px; }
  .rm-side .rm-stack.mini .rm-ev > div { display: none; }
  .rm-side .rm-stack.mini .rm-ev .ic { width: 24px; height: 24px; font-size: 14px; }
  .rm-side .rm-stack.mini { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
  .rm-side .rm-stack.mini .rm-stackbar { order: 9; }
  .rm-side > .rm-qtrack.min .rm-qt-hd, .rm-side > .rm-armytab.min .rm-ahd { padding: 5px 9px; font-size: 12px; }
}
.rm-side .rm-stack:has(> .rm-events:not([hidden]) > *) .rm-stackbar { display: flex; }
/* compact event cards in the column: name + value on one line, then the time; the long hint shows on hover */
.rm-side .rm-ev { padding: 5px 8px 5px 5px; gap: 8px; }
.rm-side .rm-ev .rm-evline { display: none; }
.rm-side .rm-ev b { font-size: 12.5px; } .rm-side .rm-ev small { font-size: 10.5px; }
.rm-side .rm-ev .ic { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.rm-side > .rm-qtrack .rm-qt-task:nth-child(n+4) { display: none; }
@media (max-width: 760px) {
  .rm-side > .rm-qtrack.min, .rm-side > .rm-armytab.min { width: auto !important; max-width: 62%; }
  .rm-side > .rm-qtrack.min .rm-qt-hd small { display: none; }
  .rm-side > .rm-qtrack.min .rm-qt-hd b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rm-side > .rm-armytab.min .rm-ahd small { display: none; }
  .rm-side .rm-stack.mini .rm-stackbar { margin: 0; align-self: center; }
  .rm-side .rm-stack.mini .rm-stackbar button { width: 26px; height: 26px; }
  .rm-side .rm-stack.mini .rm-live { flex: 1 1 100%; }
}
@media (max-width: 760px) { .rm-side .rm-stack.mini .rm-events { width: auto !important; flex: 0 0 auto; } }
@media (max-width: 760px) {
  .rm:has(.rm-skills:not(.min)) .rm-side { right: 70px; }
  .rm-side > .rm-qtrack:not(.min) .rm-qt-task:nth-child(n+3) { display: none; }
}
@media (max-width: 760px) {
  .rm-side .rm-stack .rm-stackbar { align-self: flex-start; order: -1; margin: 0 0 -2px; display: flex; }
  .rm-side .rm-stack.mini .rm-stackbar { order: 9; }
  .rm-side .rm-stack .rm-live, .rm-side .rm-stack .rm-events { cursor: pointer; }
  .rm:has(.rm-skills:not(.min)) .rm-side, .rm.sk-open .rm-side { right: 72px !important; }
}
/* 🤝 allied community lands: their colour on the tag */
.rm-tag.ally { border-color: var(--al, #7dd3fc); box-shadow: 0 0 0 2px var(--al, #7dd3fc), 0 4px 0 rgba(0,0,0,.35); }
.rm-tag.ally .dot { background: var(--al, #7dd3fc); }
/* 💀 UNDEADZ holders' lands: a gold tag with the colony badge (allies show their own colour instead) */
.rm-tag.holder { border-color: #ffd76a; box-shadow: 0 0 0 2px #ffd76a, 0 0 18px rgba(255, 215, 106, .45), 0 4px 0 rgba(0,0,0,.35); position: relative; overflow: visible; }
.rm-tag.ally { position: relative; overflow: visible; }
.rm-allycard { border-radius: 18px; overflow: hidden; border: 3px solid var(--al); background: rgba(20, 14, 30, .85); margin: 8px 0; }
.rm-allycard .cv { height: 92px; background: linear-gradient(135deg, var(--al), #2a1240) center/cover no-repeat; position: relative; }
.rm-allycard .cv img, .rm-allycard .cv .lg { position: absolute; left: 12px; bottom: -26px; width: 60px; height: 60px; border-radius: 16px; object-fit: cover; border: 3px solid var(--al); background: #1a1424; display: grid; place-items: center; font-size: 30px; }
.rm-allycard .tx { padding: 30px 12px 4px; } .rm-allycard .tx b { color: var(--al); font-size: 16px; } .rm-allycard .tx small { display: block; opacity: .75; margin-top: 2px; }
.rm-allycard .tx p { margin: 8px 0 2px; font-size: 13px; line-height: 1.45; opacity: .92; } .rm-allycard .rm-row { padding: 6px 12px 12px; flex-wrap: wrap; } .rm-allycard .rm-row:empty { display: none; }
.rm-holderstrip { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 9px 12px; border-radius: 14px; background: linear-gradient(135deg, #3a1a55, #24103a); border: 2px solid #ffd76a; box-shadow: 0 0 16px rgba(255, 215, 106, .25); }
.rm-holderstrip b { color: #ffd76a; letter-spacing: .06em; font-size: 13px; } .rm-holderstrip small { opacity: .8; font-size: 12px; }

/* the community badge on top of a land's tag (a real element: the tag's ::after is its little arrow) */
.rm-tag .cbadge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); display: none; align-items: center; gap: 4px; font: 900 9.5px/1 var(--font-ui, system-ui); letter-spacing: .07em; padding: 3px 8px 3px 3px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.35); pointer-events: none; }
.rm-tag .cbadge img { width: 15px; height: 15px; border-radius: 50%; object-fit: cover; background: #1a1424; }
.rm-tag .cbadge img[hidden] { display: none; }
.rm-tag.holder .cbadge { display: flex; color: #2a1240; background: linear-gradient(180deg, #ffe9a0, #ffc93a); }
.rm-tag.ally .cbadge { display: flex; color: #10161c; background: var(--al, #7dd3fc); }
.rm-tag.holder .cbadge:not(:has(img:not([hidden]))), .rm-tag.ally .cbadge:not(:has(img:not([hidden]))) { padding-left: 8px; }
.rm-holderstrip .hs-row { display: flex; align-items: center; gap: 8px; } .rm-holderstrip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid #ffd76a; }
/* bigger, cleaner community badge */
.rm-tag .cbadge { top: -19px; gap: 6px; font: 900 11.5px/1 var(--font-display, var(--font-ui, system-ui)); letter-spacing: .06em; padding: 4px 12px 4px 4px; border: 2px solid rgba(20, 8, 32, .85); box-shadow: 0 3px 0 rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.6), 0 0 14px rgba(255, 201, 58, .35); }
.rm-tag .cbadge img { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.rm-tag.holder .cbadge { background: linear-gradient(180deg, #fff2bf 0%, #ffd34d 48%, #f2a915 100%); text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.rm-tag.ally .cbadge { box-shadow: 0 3px 0 rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5), 0 0 12px var(--al, #7dd3fc); }
.rm-tag.holder .cbadge:not(:has(img:not([hidden]))), .rm-tag.ally .cbadge:not(:has(img:not([hidden]))) { padding-left: 12px; }
.rm-tag.holder, .rm-tag.ally { margin-top: 8px; }
.rm-tag.holder, .rm-tag.ally { padding-top: 17px; margin-top: 12px; }
.rm-tag .cbadge { top: -14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ── 🎉 party events ── */
.rm-party { --p1: #ff3af2; --p2: #3af2ff; --p3: #ffe23a; position: relative; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 20px; color: #fff; border: 3px solid var(--rm-ink); display: grid; gap: 6px; overflow: hidden;
  background: linear-gradient(135deg, rgba(60,10,90,.94), rgba(20,8,40,.94)); box-shadow: 0 5px 0 var(--rm-ink), 0 0 28px color-mix(in srgb, var(--p1) 60%, transparent); }
.rm-party::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--p1), var(--p2), var(--p3), var(--p1)); background-size: 300% 100%; opacity: .22; animation: rmPartyBg 4s linear infinite; pointer-events: none; }
.rm-party > * { position: relative; }
.rm-party.k-rainbow { --p1: #ff3a3a; --p2: #3aff6a; --p3: #3aa8ff; }
.rm-party.k-goldrush { --p1: #ffd23a; --p2: #ffb000; --p3: #fff1a0; background: linear-gradient(135deg, rgba(90,60,0,.94), rgba(34,20,4,.94)); }
.rm-party.k-ghost { --p1: #9affff; --p2: #c9a8ff; --p3: #7affc8; background: linear-gradient(135deg, rgba(14,40,60,.94), rgba(10,10,30,.94)); }
.rm-party.k-fireworks { --p1: #ff3a6a; --p2: #ffd23a; --p3: #3affd2; }
.rm-party-hd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rm-party-hd .ic { font-size: 26px; animation: rmBob 0.5s ease-in-out infinite; }
.rm-party-hd b { font: 400 20px/1.1 var(--rm-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; background: linear-gradient(90deg, #fff, var(--p3), var(--p2), #fff); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rmPartyBg 3s linear infinite; }
.rm-party-hd small { font-weight: 900; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.4); white-space: nowrap; }
.rm-party-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rm-party-row em { font-style: normal; font-weight: 900; color: var(--p3); }
.rm-party-top { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 800; }
.rm-party-top span { padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.35); } .rm-party-top span.me { background: var(--p3); color: var(--rm-ink); }
.rm-stack.mini .rm-party { padding: 6px 10px; gap: 4px; } .rm-stack.mini .rm-party > :not(.rm-party-hd) { display: none; } .rm-stack.mini .rm-party-hd b { font-size: 15px; }
@keyframes rmPartyBg { to { background-position: 300% 0; } }
/* the screen glows and colours rain down the edges while a party is on */
.rm-pfx { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.rm-pfx::before { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 90px 10px var(--pg, rgba(255,58,242,.45)); animation: rmPartyGlow 1s ease-in-out infinite alternate; }
.rm.party-rainbow .rm-pfx { --pg: rgba(58,168,255,.4); } .rm.party-goldrush .rm-pfx { --pg: rgba(255,200,40,.45); } .rm.party-ghost .rm-pfx { --pg: rgba(150,255,255,.35); } .rm.party-fireworks .rm-pfx { --pg: rgba(255,80,120,.4); }
.rm.party-disco .rm-pfx::before { animation: rmDiscoGlow 2s linear infinite; }
.rm-pfx i { position: absolute; top: -20px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; background: var(--c); opacity: .9; animation: rmConfFall var(--s) linear var(--d) infinite; }
.rm.party-goldrush .rm-pfx i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #ffb800 55%, #a86a00); box-shadow: 0 0 8px #ffd23a; }
.rm.party-ghost .rm-pfx i { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(150,255,255,0)); top: auto; bottom: -20px; animation-name: rmWisp; }
@keyframes rmConfFall { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(14px, 25vh) rotate(180deg); } 50% { transform: translate(-10px, 50vh) rotate(360deg); } 75% { transform: translate(12px, 75vh) rotate(540deg); } 100% { transform: translate(0, 105vh) rotate(720deg); } }
@keyframes rmWisp { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translate(30px, -105vh); opacity: 0; } }
@keyframes rmPartyGlow { from { opacity: .55; } to { opacity: 1; } }
@keyframes rmDiscoGlow { 0% { box-shadow: inset 0 0 90px 10px rgba(255,58,242,.5); } 33% { box-shadow: inset 0 0 90px 10px rgba(58,242,255,.5); } 66% { box-shadow: inset 0 0 90px 10px rgba(255,226,58,.5); } 100% { box-shadow: inset 0 0 90px 10px rgba(255,58,242,.5); } }
@media (prefers-reduced-motion: reduce) { .rm-pfx i { display: none; } }
/* the big "PARTY STARTED" card */
.rm-phero { position: absolute; inset: 0; z-index: 31; display: grid; place-items: center; overflow: hidden; pointer-events: none; }
.rm-phero-rays { position: absolute; width: 170vmax; height: 170vmax; background: repeating-conic-gradient(from 0deg, rgba(255,58,242,.3) 0 7deg, rgba(58,242,255,.22) 7deg 14deg, transparent 14deg 22deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 40%); mask: radial-gradient(circle, #000 0, transparent 40%); animation: rmPartySpin 8s linear infinite; }
.rm-phero-card { pointer-events: auto; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 26px 18px; border-radius: 28px; text-align: center; max-width: min(92vw, 470px); color: #fff; border: 4px solid var(--rm-ink);
  background: linear-gradient(160deg, #3a0a5a, #12062a 70%); box-shadow: 0 8px 0 var(--rm-ink), 0 0 80px rgba(255,58,242,.7); }
.rm-phero.go .rm-phero-card { animation: rmPartyIn .7s cubic-bezier(.2,1.6,.4,1) both; }
.rm-phero[hidden] { display: none; }
.rm-phero-card.k-goldrush { background: linear-gradient(160deg, #6a4200, #241404 70%); box-shadow: 0 8px 0 var(--rm-ink), 0 0 80px rgba(255,210,58,.75); }
.rm-phero-card.k-ghost { background: linear-gradient(160deg, #0e3a52, #0a0a26 70%); box-shadow: 0 8px 0 var(--rm-ink), 0 0 80px rgba(150,255,255,.6); }
.rm-phero-card.k-rainbow, .rm-phero-card.k-fireworks { box-shadow: 0 8px 0 var(--rm-ink), 0 0 80px rgba(58,168,255,.7); }
.rm-phero-card .ic { font-size: 64px; line-height: 1; margin-top: -54px; filter: drop-shadow(0 4px 0 var(--rm-ink)); animation: rmBob .5s ease-in-out infinite; }
.rm-phero-card .tag { font-weight: 900; font-size: 13px; letter-spacing: .12em; padding: 3px 12px; border-radius: 99px; background: linear-gradient(90deg, #ff3af2, #ffe23a, #3af2ff); color: var(--rm-ink); }
.rm-phero-card .t { font: 400 clamp(32px, 8.5vw, 50px)/1 var(--rm-head); color: #fff; -webkit-text-stroke: 3px var(--rm-ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--rm-ink), 0 0 24px rgba(255,58,242,.8); }
.rm-phero-card .perk { font-weight: 900; font-size: 18px; color: #ffe23a; }
.rm-phero-card .when { font-weight: 800; font-size: 14px; padding: 4px 12px; border-radius: 12px; background: rgba(0,0,0,.35); }
.rm-phero-card .faces, .rm-phero-card .pool { font-weight: 700; font-size: 14px; line-height: 1.35; max-width: 380px; }
.rm-phero-card .pool { color: #b6ff3b; font-weight: 900; }
.rm-phero-card .fc { display: inline-block; animation: rmBob .6s ease-in-out infinite; }
.rm-phero-card .rm-btn { margin-top: 6px; }
.rm-phero-card .win { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 5px; width: 100%; }
.rm-phero-card .win li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 14px; }
.rm-phero-card .win li.me { background: rgba(255,226,58,.3); } .rm-phero-card .win li b { flex: 1; text-align: left; } .rm-phero-card .win li em { font-style: normal; font-weight: 900; color: #ffe23a; font-size: 12px; }
@keyframes rmPartyIn { 0% { transform: scale(0) rotate(-10deg); } 60% { transform: scale(1.08) rotate(2deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes rmPartySpin { to { transform: rotate(360deg); } }
.rm-party-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px dashed rgba(255,226,58,.6); }
.rm-party-admin small { width: 100%; font-weight: 900; color: #ffe23a; } .rm-party-admin .rm-btn.on { outline: 2px solid #ffe23a; }
.rm.party-abuse .rm-pfx::before { animation: rmDiscoGlow .9s linear infinite; }
.rm-party.k-abuse { --p1: #ffd23a; --p2: #ff3af2; --p3: #3af2ff; box-shadow: 0 5px 0 var(--rm-ink), 0 0 34px rgba(255,210,58,.8); }
/* 🤝 ally button (top bar) */
.rm-allybtn { position: relative; width: 46px; height: 46px; border-radius: 16px; border: 3px solid var(--rm-ink); background: var(--ally, #7dd3fc); box-shadow: 0 4px 0 var(--rm-ink), 0 0 16px color-mix(in srgb, var(--ally) 60%, transparent); display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 22px; flex: none; }
.rm-allybtn img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.rm-allybtn .rm-allyv { position: absolute; right: -8px; bottom: -8px; font-style: normal; font-size: 15px; background: #ffd23a; border: 2px solid var(--rm-ink); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.rm-allybtn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--rm-ink); }
.rm-allybtns { display: flex; gap: 6px; flex: none; }
/* other communities this owner is in: small logos on the land tag */
.rm-tag .alogos { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.rm-tag .alogos[hidden] { display: none; }
.rm-tag .alogos img, .rm-tag .alogos i { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 1px 0 var(--rm-ink); font-style: normal; font-size: 10px; display: grid; place-items: center; }
.rm-tag .alogos { position: absolute; right: -10px; top: -12px; margin: 0; pointer-events: none; }
.rm-tag .alogos img, .rm-tag .alogos i { width: 22px; height: 22px; }

/* ⭐ VIP partner lands & buttons */
.rm-tag.ally.vip { border-color: #ffc93c; box-shadow: 0 0 0 3px #ffc93c, 0 0 22px rgba(255,201,60,.85), 0 4px 0 rgba(0,0,0,.35); }
.rm-tag.ally.vip .cbadge { background: linear-gradient(135deg, #fff1a8, #ffc93c 45%, #ff9f1c); color: #3a2400; box-shadow: 0 3px 0 #8a5a00, 0 0 16px rgba(255,201,60,.9); animation: vipShine 3s ease-in-out infinite; }
.rm-tag.ally.vip .dot { background: #ffc93c; }
.rm-allybtn.vip { box-shadow: 0 4px 0 var(--rm-ink), 0 0 0 3px #ffc93c, 0 0 22px rgba(255,201,60,.9); }
.rm-allybtn.vip::after { content: '⭐'; position: absolute; top: -9px; right: -9px; font-size: 15px; filter: drop-shadow(0 1px 0 #000); }
.rm-allycard.vip { box-shadow: 0 0 0 3px #ffc93c, 0 0 24px rgba(255,201,60,.7); } .rm-allycard .vip-tag { justify-self: start; width: max-content; }

/* ⭐ a party in a partner's name */
.rm-phero-card.for-ally { border: 4px solid #ffd23a; box-shadow: 0 8px 0 var(--rm-ink), 0 0 90px color-mix(in srgb, var(--al) 80%, transparent); }
.rm-phero-card .al-logo { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 5px solid #ffd23a; background: var(--al); margin-top: -50px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.rm-phero-card .al-bonus { padding: 7px 12px; border-radius: 12px; background: linear-gradient(90deg, #ffe066, #ffb000); color: #3a2200; font-weight: 900; font-size: 13.5px; max-width: 360px; }

/* 4-way direction pad while placing */
.rm-dirs { display: flex; gap: 8px; justify-content: center; margin: 2px 0 8px; }
.rm-dir { width: 46px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; font-size: 20px; cursor: pointer; }
.rm-dir.on { background: #b6ff3b; color: #10140a; border-color: #b6ff3b; box-shadow: 0 0 12px rgba(182,255,59,.45); }

/* camera pad */
.rm-cam { position: absolute; z-index: 6; right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 92px); display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; }
.rm-cambtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(14,16,10,.62); color: #fff; font-size: 19px; line-height: 1; backdrop-filter: blur(6px); cursor: pointer; touch-action: none; }
.rm-cambtn:hover { background: rgba(182,255,59,.22); } .rm-cambtn:active { background: rgba(182,255,59,.4); }
.rm.sheet-open .rm-cam, .rm.chat-open .rm-cam { display: none; }
@media (max-width: 560px) { .rm-cam { grid-template-columns: repeat(3, 38px); right: 8px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 160px); } .rm-cambtn { width: 38px; height: 38px; } }
