:root {
  --glass: rgba(16, 22, 36, 0.9);
  --glass-2: rgba(30, 38, 56, 0.95);
  --line: rgba(255, 255, 255, 0.08);
  --ink: #f3f5f9;
  --dim: #9aa4b8;
  --gold: #f6c544;
  --up: #4ade80;
  --bad: #ff5a4e;
  --warn: #ffb547;
  --blue: #3d7bfd;
  --ocean: #2c66a4;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ocean); color: var(--ink); font-family: Rubik, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex: none; }
#map { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: crosshair; }

/* ---------- menu: a live bot match behind, brand left, dock right */
#menu-screen { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-columns: 1fr minmax(340px, 420px); gap: 32px; padding: 40px 48px 64px; align-items: center; overflow: auto; }
.menu-bg { position: fixed; inset: -40px; background: url(/maps/world/base.png) center/cover; filter: blur(3px) brightness(0.8); transition: opacity 1.2s; }
#menu-screen.is-live .menu-bg { opacity: 0; }
.menu-shade { position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 14, 28, 0.8) 0%, rgba(8, 14, 28, 0.42) 34%, rgba(8, 14, 28, 0.1) 55%, rgba(8, 14, 28, 0.62) 100%),
              linear-gradient(0deg, rgba(8, 14, 28, 0.6), transparent 30%); }
.brand { position: relative; align-self: start; padding-top: 4vh; }
.logo { font-family: 'Lilita One', Rubik, sans-serif; font-weight: 400; font-size: clamp(64px, 10.5vw, 168px); line-height: 0.86; margin: 0; letter-spacing: 0.005em; color: #fff;
  -webkit-text-stroke: clamp(4px, 0.5vw, 8px) #101a30; paint-order: stroke fill;
  text-shadow: 0 0.06em 0 #101a30, 0 0.12em 0.4em rgba(0, 0, 0, 0.45); }
.logo span { color: #ff5a4e; }
.tag { margin: 18px 0 0 6px; font-size: clamp(18px, 1.7vw, 26px); font-weight: 600; color: #f2f5fa; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.live { display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 0 4px; padding: 8px 14px 8px 12px; border-radius: 999px; background: rgba(10, 16, 30, 0.6); border: 1px solid var(--line); font-size: 13.5px; color: #dbe2ee; backdrop-filter: blur(8px); max-width: 100%; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(255, 90, 78, 0.6); animation: ping 1.6s infinite; flex: none; }
.live b { color: #fff; font-weight: 700; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(255, 90, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 78, 0); } }

.dock { position: relative; background: rgba(12, 18, 32, 0.86); border: 1px solid var(--line); border-radius: 26px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); backdrop-filter: blur(16px); }
.loading { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--dim); margin-bottom: 14px; }
#menu-screen.ready .loading { display: none; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.field input { width: 100%; font: 600 17px Rubik, sans-serif; color: #fff; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
.field input:focus { border-color: #8fb3ff; }
.big { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 16px 20px; border-radius: 16px; background: var(--glass-2); border: 1px solid var(--line); margin-bottom: 10px; transition: transform .12s, filter .12s; }
.big .bt { font-family: 'Lilita One', Rubik, sans-serif; font-size: 30px; line-height: 1; letter-spacing: 0.01em; }
.big small { position: relative; font-size: 13.5px; font-weight: 500; margin-top: 6px; }
.big:hover { transform: translateY(-1px); filter: brightness(1.06); }
.big.primary { background: #ff5a4e; border-color: transparent; box-shadow: 0 5px 0 #b8322a; color: #fff; }
.big.primary small { color: #ffe1dd; }
.big.primary .fill { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: #fff; opacity: .85; transition: width .25s linear; }
.big.rejoin { background: var(--up); color: #0b2a16; border-color: transparent; box-shadow: 0 5px 0 #23a058; }
.big.rejoin { font-weight: 800; font-size: 19px; }
.big.rejoin small { color: #155c30; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 16px; }
.mode { width: 100%; padding: 11px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: #dfe5f0; font-weight: 600; font-size: 14.5px; }
.mode:hover { background: rgba(255, 255, 255, 0.11); color: #fff; }
#menu-screen:not(.ready) #modes button { opacity: .5; pointer-events: none; }
.live-now { border-top: 1px solid var(--line); padding-top: 14px; }
.lh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.lh small { letter-spacing: 0; text-transform: none; font-weight: 500; }
#live-list { display: flex; flex-direction: column; gap: 6px; }
.match { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.match .mi { flex: 1; min-width: 0; }
.match .mt { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.match .mt i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.match .ms { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match button { padding: 7px 12px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); font-weight: 700; font-size: 13px; }
.match button:hover { background: rgba(255, 255, 255, 0.16); }
.empty { font-size: 13.5px; color: var(--dim); padding: 4px 2px; line-height: 1.45; }
.staked { font-size: 12.5px; color: var(--dim); line-height: 1.5; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.note.invite { background: rgba(61, 123, 253, 0.16); border-color: rgba(143, 179, 255, 0.4); color: #dbe6ff; }
.note { background: rgba(255, 90, 78, 0.14); border: 1px solid rgba(255, 90, 78, 0.35); color: #ffd2cd; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }

.lobby-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.lobby-head b { font-family: 'Lilita One', Rubik, sans-serif; font-weight: 400; font-size: 26px; }
#lobby-status { font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.lobby-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 14px; }
.lobby-bar i { display: block; height: 100%; width: 0; background: #ff5a4e; transition: width .25s linear; }
#room-share { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; margin-bottom: 12px; }
.code { font: 700 22px ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.18em; padding: 8px 12px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; border: 1px dashed rgba(255, 255, 255, 0.2); }
#lobby-count { margin-bottom: 10px; line-height: 1.4; }
#lobby-players { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
#lobby-players li { padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-weight: 600; font-size: 13.5px; }
#lobby-players li.host::after { content: ' · host'; color: var(--gold); font-weight: 500; }
#lobby-players li.you { background: rgba(61, 123, 253, 0.35); }

.keys { position: fixed; left: 48px; bottom: 22px; list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; font-size: 12.5px; color: #c8d0de; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.credits { position: fixed; right: 48px; bottom: 22px; font-size: 11.5px; color: rgba(220, 228, 240, 0.6); }
kbd { font: 600 11px Rubik, sans-serif; background: rgba(255, 255, 255, 0.12); border-radius: 5px; padding: 1px 6px; color: #fff; }

@media (max-width: 960px) {
  #menu-screen { grid-template-columns: 1fr; padding: 24px 16px 40px; gap: 18px; align-items: start; }
  .brand { padding-top: 0; }
  .tag { margin-top: 10px; }
  .menu-shade { background: linear-gradient(180deg, rgba(8, 14, 28, 0.55), rgba(8, 14, 28, 0.75)); }
  .keys { display: none; }
  .credits { position: static; text-align: center; }
  .live { border-radius: 14px; font-size: 12.5px; align-items: flex-start; }
  .live i { margin-top: 5px; }
}

/* ---------- HUD */
#topbar { position: fixed; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 5; }
.chip { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 38px; display: flex; align-items: center; }
#quit { padding: 8px 12px; color: var(--dim); }
.watching { gap: 8px; }
.watching i { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
#quit:hover { color: #fff; }

#board { position: fixed; top: 12px; right: 12px; width: 268px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; z-index: 5; overflow: hidden; font-size: 13px; }
#board-toggle { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 10px 14px; font-weight: 700; }
#board-toggle small { color: var(--dim); font-weight: 500; }
#board.closed #board-rows { display: none; }
#board-rows { padding: 0 6px 6px; }
.row { display: grid; grid-template-columns: 20px 10px 1fr auto 52px; gap: 7px; align-items: center; padding: 5px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.row.me { background: rgba(61, 123, 253, 0.22); }
.row .rk { color: var(--dim); font-weight: 600; }
.row i { width: 10px; height: 10px; border-radius: 3px; }
.row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .pc { color: #c8d0de; }
.row .tp { text-align: right; color: var(--dim); }

#feed { position: fixed; left: 12px; bottom: 132px; width: min(380px, calc(100vw - 24px)); display: flex; flex-direction: column-reverse; gap: 6px; z-index: 6; pointer-events: none; }
.toast { pointer-events: auto; background: var(--glass); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; animation: pop .25s ease-out; transition: opacity .4s, transform .4s; }
.toast span { flex: 1; }
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--up); }
.toast.out { opacity: 0; transform: translateX(-12px); }
.toast button { padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); font-weight: 700; font-size: 12.5px; }
.toast button.yes { background: var(--up); color: #0b2a16; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

#attacks { position: fixed; left: 50%; transform: translateX(-50%); bottom: 132px; display: flex; gap: 6px; z-index: 6; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 420px); }
.atk { display: flex; align-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.atk .ico { width: 16px; height: 16px; color: var(--bad); }
.atk b { color: var(--dim); margin-left: 4px; }
.atk:hover b { color: #fff; }

#bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; overflow-x: auto; scrollbar-width: none; align-items: stretch; gap: 0; background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 10px 12px; z-index: 5; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); backdrop-filter: blur(10px); max-width: calc(100vw - 16px); }
.sec, #slots { flex: none; }
.sec { padding: 4px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.sec.me { flex-direction: row; align-items: center; gap: 12px; min-width: 170px; }
#me-swatch { width: 16px; height: 16px; border-radius: 4px; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }
#me-name { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dim { color: var(--dim); font-size: 13px; }
.lbl { display: flex; justify-content: space-between; gap: 18px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.lbl .up { color: var(--up); letter-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.lbl .gold { color: var(--gold); letter-spacing: 0; font-size: 14px; }
.val { font-size: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.val b { font-weight: 700; }
.val.gold { color: var(--gold); }
.troops { min-width: 170px; }
.meter { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); margin-top: 6px; overflow: hidden; }
#troops-bar { height: 100%; background: var(--up); border-radius: 3px; transition: width .2s; }
#ratios { display: flex; gap: 2px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 3px; margin: 2px 0 4px; }
#ratios button { padding: 4px 9px; border-radius: 7px; font-weight: 700; font-size: 14px; color: #c8d0de; }
#ratios button.on { background: var(--gold); color: #2a1d00; }
#sends { font-size: 12.5px; white-space: nowrap; }
.sec.gold { min-width: 130px; }
#slots { display: flex; gap: 6px; padding-left: 14px; align-items: center; }
.slot { position: relative; width: 66px; height: 68px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding-top: 6px; transition: background .12s, transform .12s; }
.slot:hover { background: rgba(255, 255, 255, 0.12); }
.slot.on { background: var(--blue); border-color: #8fb3ff; transform: translateY(-2px); }
.slot .hot { position: absolute; top: 4px; left: 7px; font-size: 10.5px; font-weight: 700; color: var(--dim); }
.slot .ico { width: 26px; height: 26px; color: #dfe5f0; }
.slot .cost { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: #dfe5f0; }
.slot.poor .cost { color: var(--bad); }
.slot.poor .ico { opacity: .55; }
.slot .tip { display: none; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: 180px; background: #0c111d; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--dim); text-align: left; line-height: 1.4; pointer-events: none; }
.slot .tip b { display: block; color: #fff; font-size: 13px; }
.slot:hover .tip { display: block; }

#menu { position: fixed; z-index: 10; width: 230px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px); }
#menu .mh { display: flex; align-items: center; gap: 8px; padding: 8px 8px 6px; }
#menu .mh i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
#menu .mh b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menu .mh span { color: var(--dim); font-size: 12px; }
#menu .mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 8px 8px; font-size: 11px; color: var(--dim); }
#menu .mstats b { display: block; color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
#menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 9px; font-weight: 600; font-size: 14px; text-align: left; }
#menu button .ico { width: 17px; height: 17px; }
#menu button:hover { background: rgba(255, 255, 255, 0.08); }
#menu button.danger { color: var(--bad); }

#over { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 12, 22, 0.55); z-index: 30; padding: 16px; }
#over .card { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 28px; width: min(440px, 100%); text-align: center; }
#over .title { font-family: 'Lilita One', Rubik, sans-serif; font-size: 40px; line-height: 1; margin-bottom: 10px; }
#over .sub { color: #c8d0de; margin-bottom: 20px; line-height: 1.5; }
#over .row { display: flex; gap: 8px; justify-content: center; grid-template-columns: none; }
#over button { padding: 12px 20px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); font-weight: 700; }
#over button.primary { background: var(--blue); }

/* ---------- narrower screens: tighten the bar, then let it scroll sideways */
@media (max-width: 1560px) {
  .sec { padding: 4px 13px; }
  .sec.me { min-width: 0; }
  #me-name { max-width: 120px; }
  .troops { min-width: 150px; }
  #slots { gap: 4px; padding-left: 10px; }
  .slot { width: 56px; height: 64px; }
  .slot .cost { font-size: 11.5px; }
}
@media (max-width: 1180px) {
  #bar { left: 8px; right: 8px; transform: none; overflow-x: auto; scrollbar-width: none; }
  #attacks { max-width: calc(100vw - 24px); }
}
@media (max-width: 720px) {
  #board { width: 200px; }
  #board-rows .tp { display: none; }
  .row { grid-template-columns: 18px 10px 1fr auto; }
  .sec { padding: 2px 12px; }
  .val { font-size: 20px; }
  .slot { width: 58px; height: 62px; }
  #feed { bottom: 124px; }
  .keys { grid-template-columns: 1fr; }
}

/* ---------- wallet + rewards */
.wallet-row { margin-bottom: 12px; }
.wc-label { font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.wallet-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.wallet-pick button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.wallet-pick img { width: 20px; height: 20px; border-radius: 5px; }
.wallet-pick button.missing { color: var(--dim); }
.wallet-pick button.busy { opacity: .6; pointer-events: none; }
.wallet-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.wallet-info b { display: block; font-variant-numeric: tabular-nums; }
.wallet-info small { display: block; font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.wallet-info small.ok { color: var(--up); }
.wallet-info small.no { color: var(--warn); }
.link { color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: #fff; }
.rewards { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(246, 197, 68, 0.08); border: 1px solid rgba(246, 197, 68, 0.28); margin-bottom: 12px; }
.rewards .rw-row { display: flex; flex-direction: column; }
.rewards .rw-row span { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.rewards .rw-row b { font-size: 20px; color: var(--gold); font-variant-numeric: tabular-nums; }
.rewards #rw-claim { width: auto; padding: 9px 16px; }
.rewards #rw-claim:disabled { opacity: .45; cursor: default; }
.rewards small { grid-column: 1 / -1; line-height: 1.45; }
.rewards small a { color: #dfe5f0; }
#over .reward { background: rgba(246, 197, 68, 0.12); border: 1px solid rgba(246, 197, 68, 0.35); color: #ffe7a6; border-radius: 12px; padding: 10px 12px; margin: -6px 0 18px; font-weight: 600; }

/* ---------- leaderboard */
.lh { align-items: center; }
.lb-open { margin-left: auto; padding: 5px 10px; border-radius: 8px; background: rgba(246, 197, 68, 0.14); color: var(--gold); font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.lb-open:hover { background: rgba(246, 197, 68, 0.24); }
.lh small { margin-left: 8px; }
#lb { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(8, 12, 22, 0.6); padding: 16px; }
.lb-card { width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); backdrop-filter: blur(14px); }
.lb-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lb-head b { font-family: 'Lilita One', Rubik, sans-serif; font-weight: 400; font-size: 30px; }
.lb-tabs { display: flex; gap: 2px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 3px; }
.lb-tabs button { padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: #c8d0de; }
.lb-tabs button.on { background: var(--gold); color: #2a1d00; }
.lb-close { margin-left: auto; color: var(--dim); font-size: 18px; padding: 4px 8px; }
.lb-close:hover { color: #fff; }
.lb-row { display: grid; grid-template-columns: 34px 1fr 52px 58px 58px 118px; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 10px; font-variant-numeric: tabular-nums; font-size: 14px; }
.lb-row > span:nth-child(n+3) { text-align: right; }
.lb-cols { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding-bottom: 6px; }
#lb-rows { overflow: auto; min-height: 120px; }
#lb-rows .lb-row:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.lb-row .rk { font-weight: 800; color: var(--dim); }
.lb-row.top1 .rk { color: var(--gold); }
.lb-row .who b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .who small { color: var(--dim); font-size: 12px; }
.lb-row .earn { color: var(--gold); font-weight: 700; white-space: nowrap; }
.lb-row.me { background: rgba(61, 123, 253, 0.22) !important; }
#lb-me { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
#lb-me:empty { display: none; }
.lb-empty { padding: 26px 10px; text-align: center; color: var(--dim); line-height: 1.5; }
.lb-foot { margin-top: 12px; line-height: 1.45; }
@media (max-width: 560px) {
  .lb-row { grid-template-columns: 28px 1fr 44px 76px; }
  .lb-row > span:nth-child(4), .lb-row > span:nth-child(5) { display: none; }
  .lb-head { flex-wrap: wrap; }
}

.big.primary.locked { filter: saturate(0.35) brightness(0.85); }

/* ---------- contract address */
.ca-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0 4px; max-width: 100%; }
.ca-pill { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 7px 8px 7px 8px; border-radius: 12px; background: rgba(10, 16, 30, 0.72); border: 1px solid var(--line); backdrop-filter: blur(8px); color: #e9eef6; }
.ca-pill:hover { border-color: rgba(255, 255, 255, 0.3); }
.ca-tag { font-weight: 800; font-size: 11.5px; letter-spacing: 0.08em; padding: 3px 7px; border-radius: 7px; background: #ff5a4e; color: #fff; flex: none; }
.ca-pill code { font: 600 13.5px ui-monospace, 'SF Mono', Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-act { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); flex: none; }
.ca-pill.copied .ca-act { background: var(--up); color: #0b2a16; }
.ca-buy { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 12px; background: var(--up); color: #0b2a16; font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: 0 4px 0 #23a058; }
.ca-buy:hover { filter: brightness(1.08); }
@media (max-width: 960px) { .ca-row { margin-top: 12px; } .ca-pill code { font-size: 12.5px; } }
