/* =====================================================================
 * Survival.io — uinew.css  (v1.4 the new UI · html.ui-new)
 * One look for every screen: dark slate panels with a 3 px ink outline and
 * a chunky lip, Lilita One with an ink outline for labels and numbers,
 * the game's own drawn icons. Sizes follow --u: 1 unit = 1 px on a
 * 1280×720 screen, and grow / shrink with the screen (phones use a
 * tighter 900×420 base so things stay big enough to touch).
 * ===================================================================== */
html.ui-new {
  --u: min(calc(100vw / 1280), calc(var(--vh100) / 720));
  --ink: #1d1a17; --cream: #fff8e6; --dimc: #c9c2b0;
  --gold1: #ffd84a; --gold2: #f39a1b; --green1: #8ee04f; --green2: #3fa92a; --red1: #ff7564; --red2: #d43a2e;
  --blue1: #6cc0ff; --blue2: #2c78de; --purple1: #c39bff; --purple2: #7447de; --teal1: #5fe0b4; --teal2: #1f9f7c; --orange1: #ffb24a; --orange2: #e5701c;
  --slate1: #2f3648; --slate2: #1d2230;
  --nl-out: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 4px 0 var(--ink);
  --nl-out-s: 0 1.5px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink);
}
@media (max-height: 560px) { html.ui-new { --u: min(calc(100vw / 900), calc(var(--vh100) / 420)); } }
:where(html.ui-new) .uic { display: block; width: 100%; height: 100%; }

/* ---------------- the classic lobby steps aside ---------------- */
html.ui-new #lobby > .lobby-top, html.ui-new #kmCard, html.ui-new #lobbyMenu, html.ui-new #lobby > .lobby-foot { display: none !important; }
html.ui-new #lobby .lobby-shade { background: radial-gradient(ellipse at 50% 55%, rgba(0, 0, 0, 0) 30%, rgba(8, 10, 16, 0.55) 100%), rgba(8, 10, 16, 0.18); }
html.ui-new #lobby.has-panel #nlobby { display: none; }
#nlobby, #nlPicker, #nlSheet, #nlFlash { display: none; }
html.ui-new #nlobby { display: block; position: absolute; inset: 0; pointer-events: none; font-family: var(--font-body); color: var(--cream); }
html.ui-new #nlobby > *, html.ui-new #nlobby .nl-center > * { pointer-events: auto; }

/* shared pieces */
.nl-chip, .nl-prof, .nl-card, .nl-mode, .nl-sheet, .nl-pick, .nl-flash {
  background: linear-gradient(180deg, var(--slate1), var(--slate2)); border: 3px solid var(--ink); border-radius: calc(18 * var(--u));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 5px 0 var(--ink), 0 12px 26px rgba(0, 0, 0, 0.35);
}
.nl-play, .nl-dk, .nl-sq, .nl-arrow, .nl-add, .nl-open, .nl-custom, .nl-si, .nl-x {
  border: 3px solid var(--ink); cursor: pointer; color: var(--cream); font-family: var(--font-display);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 6px 0 var(--ink), 0 12px 22px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.nl-play:active, .nl-dk:active, .nl-sq:active, .nl-arrow:active, .nl-add:active, .nl-open:active, .nl-custom:active, .nl-si:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 2px 0 var(--ink); }
.nl-play:hover, .nl-dk:hover, .nl-sq:hover, .nl-open:hover, .nl-custom:hover, .nl-si:hover { filter: brightness(1.08); }
.nl-dt, .nl-play span, .nl-dk b, .nl-open, .nl-custom span, .nl-mode-t b, .nl-who b, .nl-chip b, .nl-ct, .nl-st b, .nl-stars b, .nl-logo, .nl-pick h2, .nl-mc b, .nl-si b, .nl-sheet h3, .nl-lv, .nl-tag {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 0.3px; color: var(--cream); text-shadow: var(--nl-out-s);
}
.nl-tag { position: absolute; top: calc(-14 * var(--u)); left: calc(20 * var(--u)); padding: calc(2 * var(--u)) calc(10 * var(--u)); border: 3px solid var(--ink); border-radius: 10px; font-size: calc(16 * var(--u)); font-style: normal; background: linear-gradient(180deg, var(--orange1), var(--orange2)); box-shadow: 0 3px 0 var(--ink); z-index: 2; }
.nl-tag.gold { background: linear-gradient(180deg, var(--gold1), var(--gold2)); color: #4a2a00; text-shadow: none; }
.nl-tag.red { background: linear-gradient(180deg, var(--red1), var(--red2)); }

/* top bar */
.nl-top { position: absolute; top: calc(18 * var(--u)); left: calc(22 * var(--u)); right: calc(22 * var(--u)); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.nl-top > * { pointer-events: auto; }
.nl-prof { position: relative; display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(6 * var(--u)) calc(20 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u)); border-radius: calc(22 * var(--u)); cursor: pointer; color: var(--cream); min-width: calc(300 * var(--u)); }
.nl-ava { width: calc(78 * var(--u)); height: calc(78 * var(--u)); border-radius: 50%; border: 3px solid var(--ink); overflow: hidden; background: radial-gradient(circle at 50% 40%, #6c8f4a, #2f4a25); box-shadow: 0 0 0 calc(3 * var(--u)) #ffc832; flex: none; }
.nl-ava canvas { width: 100%; height: 100%; display: block; }
.nl-lv { position: absolute; left: calc(58 * var(--u)); top: calc(58 * var(--u)); width: calc(34 * var(--u)); height: calc(34 * var(--u)); border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; font-size: calc(18 * var(--u)); background: linear-gradient(180deg, var(--gold1), var(--gold2)); color: #4a2a00; text-shadow: none; }
.nl-who { display: flex; flex-direction: column; align-items: flex-start; gap: calc(2 * var(--u)); min-width: 0; }
.nl-who b { font-size: calc(28 * var(--u)); line-height: 1.05; max-width: calc(210 * var(--u)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-who small { font-size: calc(14 * var(--u)); color: var(--dimc); font-weight: 800; }
.nl-xp { display: block; width: calc(200 * var(--u)); height: calc(15 * var(--u)); border: 3px solid var(--ink); border-radius: 99px; background: #11141b; overflow: hidden; }
.nl-xp > i { display: block; height: 100%; background: linear-gradient(180deg, #8ff0ff, #32b4e8); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4); border-radius: 99px; min-width: 6%; }
.nl-right { display: flex; gap: calc(14 * var(--u)); align-items: center; }
.nl-chip { display: flex; align-items: center; gap: calc(8 * var(--u)); height: calc(60 * var(--u)); padding: 0 calc(14 * var(--u)) 0 calc(10 * var(--u)); color: var(--cream); }
.nl-chip > .uic { width: calc(38 * var(--u)); height: calc(38 * var(--u)); }
.nl-chip b { font-size: calc(28 * var(--u)); }
.nl-trophy { cursor: pointer; }
.nl-trophy span { display: flex; flex-direction: column; line-height: 1; align-items: flex-start; }
.nl-trophy b { font-size: calc(22 * var(--u)); }
.nl-trophy small { font-size: calc(12 * var(--u)); color: #ffcf8a; font-weight: 900; }
.nl-add { width: calc(44 * var(--u)); height: calc(44 * var(--u)); border-radius: calc(13 * var(--u)); padding: calc(8 * var(--u)); background: linear-gradient(180deg, var(--green1), var(--green2)); margin-right: calc(-6 * var(--u)); }
.nl-sq { width: calc(64 * var(--u)); height: calc(60 * var(--u)); border-radius: calc(16 * var(--u)); padding: calc(10 * var(--u)); background: linear-gradient(180deg, #46506a, #2b3245); }
html.portal.ui-new .nl-add { display: none; }

/* logo */
.nl-logo { position: absolute; left: 0; right: 0; top: calc(140 * var(--u)); margin: 0; text-align: center; font-size: calc(96 * var(--u)); letter-spacing: 1px; text-shadow: var(--nl-out); pointer-events: none !important; line-height: 1; }
.nl-logo span { color: #ffc832; }

/* centre: mode switch + PLAY */
.nl-center { position: absolute; left: 50%; top: calc(300 * var(--u)); transform: translateX(-50%); width: calc(420 * var(--u)); display: flex; flex-direction: column; align-items: stretch; gap: calc(20 * var(--u)); pointer-events: none; }
.nl-mode { position: relative; display: flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(8 * var(--u)); border-radius: calc(20 * var(--u)); }
.nl-mode.one { display: none; }
.nl-mode.has-new::after { content: ''; position: absolute; right: calc(-6 * var(--u)); top: calc(-6 * var(--u)); width: calc(18 * var(--u)); height: calc(18 * var(--u)); border-radius: 50%; background: #ff4d4d; border: 3px solid var(--ink); }
.nl-arrow { width: calc(54 * var(--u)); height: calc(54 * var(--u)); flex: none; border-radius: calc(14 * var(--u)); padding: calc(12 * var(--u)); background: linear-gradient(180deg, #46506a, #2b3245); }
.nl-mode-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: calc(10 * var(--u)); background: none; border: 0; color: var(--cream); cursor: pointer; padding: 0 calc(4 * var(--u)); text-align: start; }
.nl-mode-ic { width: calc(48 * var(--u)); height: calc(48 * var(--u)); flex: none; }
.nl-mode-t { display: flex; flex-direction: column; min-width: 0; }
.nl-mode-t b { font-size: calc(28 * var(--u)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl-mode-t small { font-size: calc(14 * var(--u)); color: var(--dimc); font-weight: 800; white-space: nowrap; }
.nl-play { display: flex; align-items: center; justify-content: center; gap: calc(16 * var(--u)); height: calc(122 * var(--u)); border-radius: calc(28 * var(--u)); background: linear-gradient(180deg, var(--gold1), var(--gold2)); }
.nl-play .uic { width: calc(58 * var(--u)); height: calc(58 * var(--u)); flex: none; }
.nl-play span { font-size: calc(66 * var(--u)); letter-spacing: 2px; text-shadow: var(--nl-out); }
.nl-hand { display: none; position: absolute; width: calc(84 * var(--u)); height: calc(84 * var(--u)); right: calc(-34 * var(--u)); bottom: calc(-46 * var(--u)); pointer-events: none !important; animation: nlTap 1.2s ease-in-out infinite; transform-origin: 30% 10%; }
#nlobby.fresh .nl-hand, #nlobby.hint .nl-hand { display: block; }
#nlobby.fresh .nl-play { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 6px 0 var(--ink), 0 0 0 8px rgba(255, 224, 102, 0.35), 0 0 44px rgba(255, 210, 70, 0.8); animation: nlGlow 1.6s ease-in-out infinite; }
#nlobby.fresh .nl-center { top: calc(360 * var(--u)); }
@keyframes nlTap { 0%, 100% { transform: rotate(-24deg) translate(0, 0); } 50% { transform: rotate(-24deg) translate(-8px, -10px) scale(0.94); } }
@keyframes nlGlow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }

/* side cards */
.nl-card { position: absolute; top: calc(300 * var(--u)); width: calc(290 * var(--u)); height: calc(236 * var(--u)); border-radius: calc(22 * var(--u)); color: var(--cream); font-family: var(--font-body); }
.nl-story { left: calc(40 * var(--u)); cursor: pointer; text-align: start; overflow: visible; background: linear-gradient(160deg, rgba(255, 154, 60, 0.32), rgba(0, 0, 0, 0) 60%), linear-gradient(180deg, var(--slate1), var(--slate2)); }
.nl-story:hover { filter: brightness(1.07); }
.nl-story.is-new { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 var(--ink), 0 0 0 4px #ff9a3c, 0 0 30px rgba(255, 154, 60, 0.6); }
.nl-sic { position: absolute; left: calc(18 * var(--u)); top: calc(24 * var(--u)); width: calc(86 * var(--u)); height: calc(86 * var(--u)); }
.nl-st { position: absolute; left: calc(114 * var(--u)); top: calc(30 * var(--u)); right: calc(10 * var(--u)); display: flex; flex-direction: column; }
.nl-st b { font-size: calc(24 * var(--u)); }
.nl-st small { font-family: var(--font-display); font-size: calc(20 * var(--u)); color: #ffcf8a; text-shadow: var(--nl-out-s); }
.nl-stars { position: absolute; left: calc(20 * var(--u)); top: calc(128 * var(--u)); display: flex; align-items: center; gap: calc(6 * var(--u)); }
.nl-stars .uic { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
.nl-stars b { font-size: calc(24 * var(--u)); }
.nl-bar { position: absolute; left: calc(20 * var(--u)); right: calc(20 * var(--u)); top: calc(168 * var(--u)); height: calc(18 * var(--u)); border: 3px solid var(--ink); border-radius: 99px; background: #11141b; overflow: hidden; }
.nl-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(180deg, #ffe36a, #f0a51e); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4); min-width: 4%; }
.nl-next { position: absolute; left: calc(20 * var(--u)); top: calc(196 * var(--u)); display: flex; align-items: center; gap: 6px; font-size: calc(14 * var(--u)); font-weight: 800; color: var(--dimc); }
.nl-next .uic { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.nl-chest { right: calc(40 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(6 * var(--u)); border-color: #2a1d00; background: linear-gradient(180deg, #4a3a1a, #2a2214); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 var(--ink), 0 0 0 3px #ffc832, 0 0 34px rgba(255, 200, 50, 0.45); }
.nl-chest.done { background: linear-gradient(180deg, var(--slate1), var(--slate2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 var(--ink); }
.nl-chest.done .nl-cic { filter: saturate(0.4) brightness(0.8); }
.nl-cic { width: calc(120 * var(--u)); height: calc(100 * var(--u)); }
.nl-chest:not(.done) .nl-cic { animation: nlWob 2.4s ease-in-out infinite; }
@keyframes nlWob { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-5deg); } 90% { transform: rotate(5deg); } 95% { transform: rotate(-3deg); } }
.nl-ct { font-size: calc(26 * var(--u)); }
.nl-open { padding: calc(6 * var(--u)) calc(44 * var(--u)); border-radius: calc(14 * var(--u)); font-size: calc(24 * var(--u)); background: linear-gradient(180deg, var(--green1), var(--green2)); text-shadow: var(--nl-out-s); }
/* v1.5.4 what the chest holds (today / tomorrow) or "play a battle first" */
.nl-cxp { margin-top: calc(-4 * var(--u)); font: 400 calc(16 * var(--u)) / 1.1 var(--font-display); color: #ffd86a; text-shadow: var(--nl-out-s); text-align: center; padding: 0 calc(6 * var(--u)); }
.nl-chest.done .nl-cxp { color: #cfe3ff; }
.nl-chest.held .nl-cxp { color: #fff; font-size: calc(14 * var(--u)); }
.nl-miss { position: absolute; bottom: calc(-30 * var(--u)); left: 0; right: 0; text-align: center; font-size: calc(14 * var(--u)); font-weight: 800; color: var(--dimc); text-shadow: 0 1px 2px #000; }

/* dock */
.nl-dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(28 * var(--u)); display: flex; gap: calc(16 * var(--u)); }
.nl-dk { position: relative; width: calc(116 * var(--u)); height: calc(104 * var(--u)); border-radius: calc(22 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(2 * var(--u)); padding: 0; }
.nl-dk-ic { width: calc(52 * var(--u)); height: calc(52 * var(--u)); }
.nl-dk b { font-size: calc(19 * var(--u)); }
.nl-dk.purple { background: linear-gradient(180deg, var(--purple1), var(--purple2)); }
.nl-dk.orange { background: linear-gradient(180deg, var(--orange1), var(--orange2)); }
.nl-dk.blue { background: linear-gradient(180deg, var(--blue1), var(--blue2)); }
.nl-dk.teal { background: linear-gradient(180deg, var(--teal1), var(--teal2)); }
.nl-dk.locked { filter: saturate(0.15) brightness(0.72); }
.nl-dk.locked:hover { filter: saturate(0.15) brightness(0.8); }
.nl-dk .nl-lock { position: absolute; right: calc(-8 * var(--u)); top: calc(-14 * var(--u)); width: calc(32 * var(--u)); height: calc(32 * var(--u)); }
.nl-dk .nl-new { position: absolute; right: calc(-10 * var(--u)); top: calc(-12 * var(--u)); padding: 1px calc(7 * var(--u)); border: 3px solid var(--ink); border-radius: 9px; background: linear-gradient(180deg, var(--red1), var(--red2)); font: 400 calc(13 * var(--u)) var(--font-display); font-style: normal; color: #fff; box-shadow: 0 3px 0 var(--ink); animation: nlBob 1.2s ease-in-out infinite; }
.nl-dk.dot::after { content: ''; position: absolute; right: calc(-6 * var(--u)); top: calc(-6 * var(--u)); width: calc(18 * var(--u)); height: calc(18 * var(--u)); border-radius: 50%; background: #ff4d4d; border: 3px solid var(--ink); }
@keyframes nlBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* the flash (locked things) */
html.ui-new #nlFlash { display: flex; position: fixed; left: 50%; top: calc(110 * var(--u)); transform: translate(-50%, -20px); align-items: center; gap: 10px; padding: calc(10 * var(--u)) calc(20 * var(--u)); font: 400 calc(22 * var(--u)) var(--font-display); color: var(--cream); text-shadow: var(--nl-out-s); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; white-space: nowrap; }
html.ui-new #nlFlash .uic { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
html.ui-new #nlFlash.show { opacity: 1; transform: translate(-50%, 0); }

/* the ☰ sheet */
html.ui-new #nlSheet:not(.hidden), html.ui-new #nlPicker:not(.hidden) { display: grid; place-items: center; position: fixed; inset: 0; z-index: 40; background: rgba(8, 10, 16, 0.6); pointer-events: auto; }
.nl-sheet { position: relative; width: min(calc(560 * var(--u)), 92vw); padding: calc(22 * var(--u)); border-radius: calc(24 * var(--u)); }
.nl-sheet h3 { margin: 0 0 calc(16 * var(--u)); font-size: calc(34 * var(--u)); }
.nl-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(14 * var(--u)); }
.nl-si { display: flex; flex-direction: column; align-items: center; gap: calc(6 * var(--u)); padding: calc(14 * var(--u)) calc(6 * var(--u)); border-radius: calc(18 * var(--u)); background: linear-gradient(180deg, #46506a, #2b3245); }
.nl-si span { width: calc(48 * var(--u)); height: calc(48 * var(--u)); }
.nl-si b { font-size: calc(18 * var(--u)); }
.nl-x { position: absolute; right: calc(16 * var(--u)); top: calc(16 * var(--u)); width: calc(50 * var(--u)); height: calc(50 * var(--u)); border-radius: calc(14 * var(--u)); background: linear-gradient(180deg, #46506a, #2b3245); font-size: calc(24 * var(--u)); text-shadow: var(--nl-out-s); }

/* Choose your battle */
.nl-pick { position: relative; width: min(calc(1180 * var(--u)), 96vw); max-height: calc(var(--vh100) - 16px); padding: calc(16 * var(--u)) calc(26 * var(--u)) calc(20 * var(--u)); border-radius: calc(26 * var(--u)); display: flex; flex-direction: column; gap: calc(12 * var(--u)); }
.nl-pick h2 { margin: 0; text-align: center; font-size: calc(40 * var(--u)); text-shadow: var(--nl-out); line-height: 1.1; }
.nl-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(16 * var(--u)); overflow-y: auto; padding: calc(14 * var(--u)) calc(4 * var(--u)) calc(8 * var(--u)); }
.nl-mc { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(4 * var(--u)); padding: 0 0 calc(12 * var(--u)); border: 3px solid var(--ink); border-radius: calc(22 * var(--u)); background: linear-gradient(180deg, var(--slate1), var(--slate2)); color: var(--cream); cursor: pointer; overflow: visible; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 var(--ink); font-family: var(--font-body); text-align: center; transition: transform 0.1s; }
.nl-mc:hover { transform: translateY(-3px); }
.nl-mc.sel { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 var(--ink), 0 0 0 4px #ffc832, 0 0 30px rgba(255, 200, 50, 0.5); }
.nl-mc.locked { filter: saturate(0.2) brightness(0.7); }
.nl-mc-art { display: grid; place-items: center; width: 100%; height: calc(92 * var(--u)); border-radius: calc(19 * var(--u)) calc(19 * var(--u)) 0 0; background: radial-gradient(circle at 50% 60%, var(--a) 0, var(--b) 75%); }
.nl-mc-art .uic { width: calc(70 * var(--u)); height: calc(70 * var(--u)); }
.nl-mc b { font-size: calc(22 * var(--u)); margin-top: calc(4 * var(--u)); }
.nl-mc small { font-size: calc(13.5 * var(--u)); color: var(--dimc); font-weight: 800; line-height: 1.25; padding: 0 calc(12 * var(--u)); min-height: 2.5em; }
.nl-mc-tags { display: flex; gap: calc(6 * var(--u)); flex-wrap: wrap; justify-content: center; margin-top: calc(4 * var(--u)); }
.nl-mc-tags i { font-style: normal; font-size: calc(13 * var(--u)); font-weight: 900; padding: calc(3 * var(--u)) calc(9 * var(--u)); border-radius: 99px; background: rgba(0, 0, 0, 0.3); border: 2px solid rgba(0, 0, 0, 0.5); display: flex; align-items: center; gap: 4px; }
.nl-mc-tags i.lk .uic { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }
.nl-pick-foot { display: flex; align-items: center; gap: calc(18 * var(--u)); }
.nl-diff { display: flex; gap: calc(8 * var(--u)); padding: calc(8 * var(--u)); border-radius: calc(20 * var(--u)); background: rgba(0, 0, 0, 0.25); border: 3px solid var(--ink); }
.nl-diff.hidden { visibility: hidden; display: flex !important; }
.nl-diff button { min-width: calc(118 * var(--u)); height: calc(52 * var(--u)); border: 3px solid var(--ink); border-radius: calc(14 * var(--u)); background: linear-gradient(180deg, #46506a, #2b3245); color: var(--cream); font: 400 calc(22 * var(--u)) var(--font-display); text-shadow: var(--nl-out-s); cursor: pointer; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 4px 0 var(--ink); }
.nl-diff button.on { background: linear-gradient(180deg, var(--green1), var(--green2)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 4px 0 var(--ink); }
.nl-custom { display: flex; align-items: center; gap: calc(8 * var(--u)); height: calc(68 * var(--u)); padding: 0 calc(20 * var(--u)); border-radius: calc(18 * var(--u)); background: linear-gradient(180deg, #46506a, #2b3245); }
.nl-custom .uic { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.nl-custom span { font-size: calc(22 * var(--u)); }
.nl-play-s { margin-inline-start: auto; height: calc(92 * var(--u)); min-width: calc(320 * var(--u)); border-radius: calc(24 * var(--u)); }
.nl-play-s span { font-size: calc(52 * var(--u)); }
.nl-play-s .uic { width: calc(46 * var(--u)); height: calc(46 * var(--u)); }

/* phones & short screens: no logo, tighter cards */
@media (max-height: 560px) {
  .nl-logo { display: none; }
  .nl-top { top: calc(10 * var(--u)); left: calc(12 * var(--u)); right: calc(12 * var(--u)); }
  .nl-prof { min-width: 0; padding-inline-end: calc(14 * var(--u)); }
  .nl-ava { width: calc(58 * var(--u)); height: calc(58 * var(--u)); }
  .nl-lv { left: calc(46 * var(--u)); top: calc(46 * var(--u)); width: calc(28 * var(--u)); height: calc(28 * var(--u)); font-size: calc(15 * var(--u)); }
  .nl-who b { font-size: calc(23 * var(--u)); }
  .nl-who small { display: none; }
  .nl-xp { width: calc(140 * var(--u)); height: calc(13 * var(--u)); }
  .nl-chip { height: calc(52 * var(--u)); }
  .nl-chip b { font-size: calc(23 * var(--u)); }
  .nl-trophy small { display: none; }
  .nl-sq { width: calc(52 * var(--u)); height: calc(52 * var(--u)); padding: calc(8 * var(--u)); }
  .nl-center { top: calc(108 * var(--u)); width: calc(300 * var(--u)); gap: calc(14 * var(--u)); }
  #nlobby.fresh .nl-center { top: calc(130 * var(--u)); }
  .nl-mode { padding: calc(6 * var(--u)); }
  .nl-arrow { width: calc(42 * var(--u)); height: calc(42 * var(--u)); padding: calc(9 * var(--u)); }
  .nl-mode-ic { width: calc(36 * var(--u)); height: calc(36 * var(--u)); }
  .nl-mode-t b { font-size: calc(21 * var(--u)); }
  .nl-mode-t small { font-size: calc(12 * var(--u)); }
  .nl-play { height: calc(96 * var(--u)); border-radius: calc(24 * var(--u)); }
  .nl-play span { font-size: calc(52 * var(--u)); }
  .nl-play .uic { width: calc(46 * var(--u)); height: calc(46 * var(--u)); }
  .nl-card { top: calc(112 * var(--u)); width: calc(206 * var(--u)); height: calc(176 * var(--u)); }
  .nl-story { left: calc(18 * var(--u)); }
  .nl-chest { right: calc(18 * var(--u)); }
  .nl-sic { left: calc(12 * var(--u)); top: calc(18 * var(--u)); width: calc(62 * var(--u)); height: calc(62 * var(--u)); }
  .nl-st { left: calc(82 * var(--u)); top: calc(20 * var(--u)); }
  .nl-st b { font-size: calc(19 * var(--u)); }
  .nl-st small { font-size: calc(16 * var(--u)); }
  .nl-stars { left: calc(14 * var(--u)); top: calc(96 * var(--u)); }
  .nl-stars b { font-size: calc(20 * var(--u)); }
  .nl-stars .uic { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }
  .nl-bar { left: calc(14 * var(--u)); right: calc(14 * var(--u)); top: calc(130 * var(--u)); height: calc(15 * var(--u)); }
  .nl-next { display: none; }
  .nl-cic { width: calc(92 * var(--u)); height: calc(78 * var(--u)); }
  .nl-ct { font-size: calc(19 * var(--u)); }
  .nl-open { font-size: calc(20 * var(--u)); padding: calc(4 * var(--u)) calc(30 * var(--u)); }
  .nl-miss { bottom: calc(-24 * var(--u)); font-size: calc(12 * var(--u)); }
  .nl-dock { bottom: calc(12 * var(--u)); gap: calc(12 * var(--u)); }
  .nl-dk { width: calc(84 * var(--u)); height: calc(76 * var(--u)); border-radius: calc(18 * var(--u)); }
  .nl-dk-ic { width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
  .nl-dk b { font-size: calc(15 * var(--u)); }
  .nl-pick { padding: calc(12 * var(--u)) calc(16 * var(--u)); gap: calc(10 * var(--u)); }
  .nl-pick h2 { font-size: calc(30 * var(--u)); }
  .nl-cards { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc(196 * var(--u)); overflow-x: auto; overflow-y: hidden; padding-bottom: calc(10 * var(--u)); }
  .nl-mc-art { height: calc(84 * var(--u)); }
  .nl-mc-art .uic { width: calc(66 * var(--u)); height: calc(66 * var(--u)); }
  .nl-mc small { font-size: calc(12.5 * var(--u)); }
  .nl-diff button { min-width: calc(96 * var(--u)); height: calc(46 * var(--u)); font-size: calc(19 * var(--u)); }
  .nl-custom { height: calc(56 * var(--u)); }
  .nl-play-s { height: calc(70 * var(--u)); min-width: calc(230 * var(--u)); }
  .nl-play-s span { font-size: calc(40 * var(--u)); }
}
/* right-to-left languages keep the cards on their sides */
html[dir="rtl"].ui-new .nl-tag { left: auto; right: calc(20 * var(--u)); }

/* =====================================================================
 * MATCH HUD (computer; phones below)
 * ===================================================================== */
html.ui-new .hud { zoom: calc(var(--ui) * var(--nz, 1)); --zf: calc(var(--ui) * var(--nz, 1)); }
html.ui-new .hud .glass, html.ui-new #armyPanel, html.ui-new #kingdomPanel, html.ui-new #buildingPanel, html.ui-new .side-panel {
  /* v1.4 always a little see-through: the map stays visible behind every card */
  background: linear-gradient(180deg, rgba(42, 49, 66, 0.8), rgba(26, 30, 41, 0.84)); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), 0 4px 0 rgba(29, 26, 23, 0.9), 0 10px 22px rgba(0, 0, 0, 0.3); backdrop-filter: none; -webkit-backdrop-filter: none;
}
html.ui-new .nhd, html.ui-new .player-name, html.ui-new .res-count, html.ui-new .bp-name, html.ui-new .recipe-name, html.ui-new .tc-name, html.ui-new #nhGoal b, html.ui-new .nh-rank b, html.ui-new .nh-army b,
html.ui-new .action-toggle span, html.ui-new .panel-title span, html.ui-new .k-score, html.ui-new .nb-tabs span, html.ui-new .nh-attack span, html.ui-new .mb-timer, html.ui-new .hp-text {
  font-family: var(--font-display); font-weight: 400; color: var(--cream); text-shadow: var(--nl-out-s); letter-spacing: 0.3px;
}
/* player card */
html.ui-new #playerCard { top: 14px; left: 16px; padding: 6px 16px 6px 6px; gap: 10px; min-width: 280px; border-radius: 22px; background: rgba(22, 26, 35, 0.66); }
html.ui-new #avatarCanvas { width: 66px; height: 66px; border: 3px solid var(--ink); box-shadow: 0 0 0 3px #ffc832; }
html.ui-new .player-name { font-size: 22px; margin-bottom: 6px; max-width: 190px; }
html.ui-new .hp-bar { height: 24px; border: 3px solid var(--ink); border-radius: 99px; background: #11141b; }
html.ui-new .hp-fill { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35); border-radius: 99px; }
html.ui-new .hp-text { font-size: 15px; }
html.ui-new #playerCard .eat-btn { display: none; }
html.ui-new.nh-hurt #playerCard .eat-btn { display: flex; border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, var(--red1), var(--red2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 4px 0 var(--ink); color: var(--cream); animation: nlBob 1.2s ease-in-out infinite; }
html.ui-new .pc-lv { display: none !important; }
/* resources */
html.ui-new #resourceBar { top: 12px; padding: 6px 12px; gap: 6px; border-radius: 20px; background: rgba(22, 26, 35, 0.62); }
html.ui-new .res { background: none; padding: 2px 8px 2px 2px; min-width: 84px; gap: 6px; }
html.ui-new .res-icon { width: 38px; height: 38px; }
html.ui-new .res-count { font-size: 28px; }
html.ui-new .res-rate { display: none; }
/* the clock + the goal */
html.ui-new #matchBar { top: 86px; padding: 2px 12px; gap: 8px; border-radius: 99px; background: rgba(22, 26, 35, 0.6); }
html.ui-new #matchBar .mb-mode { display: none; }
html.ui-new .mb-timer { font-size: 22px; }
html.ui-new #nhGoal { position: absolute; top: 128px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 4px 16px 4px 6px; border-radius: 99px; border: 3px solid var(--ink); background: rgba(40, 32, 10, 0.78); box-shadow: 0 4px 0 var(--ink), 0 0 0 2px #ffc832; pointer-events: none; white-space: nowrap; max-width: 560px; }
html.ui-new #nhGoal.hidden { display: none; }
html.ui-new .nh-gi { width: 38px; height: 38px; flex: none; }
html.ui-new .nh-gt { font-size: 21px; overflow: hidden; text-overflow: ellipsis; }
html.ui-new .nh-gn { font-size: 21px; color: #ffe066 !important; }
html.ui-new #questPanel { display: none !important; }
/* right column: minimap, rank chip, menu */
html.ui-new .right-col { top: 14px; right: 16px; width: 196px; gap: 14px; }
html.ui-new .minimap-wrap, html.ui-new .right-col .minimap-wrap { top: 0; right: 0; padding: 6px; border-radius: 22px; }
html.ui-new #minimap { width: 176px; height: 176px; border: 0; border-radius: 16px; }
html.ui-new .minimap-footer { display: none; }
html.ui-new #nhMenu { position: absolute; top: 14px; right: 224px; width: 58px; height: 58px; padding: 10px; border: 3px solid var(--ink); border-radius: 16px; cursor: pointer; background: linear-gradient(180deg, #46506a, #2b3245); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), 0 5px 0 var(--ink); }
html.ui-new #nhMenu:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
html.ui-new .nh-rank { display: flex; align-items: center; gap: 6px; margin: 0; padding: 5px 12px; border: 3px solid var(--ink); border-radius: 14px; background: rgba(22, 26, 35, 0.7); color: var(--cream); cursor: pointer; box-shadow: 0 4px 0 var(--ink); align-self: stretch; }
html.ui-new .nh-rank.hidden { display: none; }
html.ui-new .nh-rank .uic { width: 28px; height: 28px; flex: none; }
html.ui-new .nh-rank b { font-size: 22px; }
html.ui-new .nh-rank small { font-size: 15px; font-weight: 800; color: var(--dimc); }
html.ui-new .nh-rank.on { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px #ffc832; }
html.ui-new #kingdomPanel { display: none; position: relative; margin: 0; padding: 8px 10px 10px; }
html.ui-new #kingdomPanel.nh-open { display: block; width: 264px; align-self: flex-end; }
html.ui-new #kingdomPanel .panel-title { min-height: 30px; margin: 0 0 4px; padding-inline-end: 38px; }
html.ui-new #kingdomPanel .panel-title span { font-size: 19px; }
html.ui-new #kingdomList { gap: 2px; max-height: calc(var(--vh100) / var(--nz, 1) - 380px); min-height: 90px; overflow-y: auto; }
html.ui-new .kingdom-list li { grid-template-columns: 18px 12px minmax(0, 1fr) auto auto; gap: 6px; font-size: 13.5px; line-height: 1.25; padding: 2px 6px; border-radius: 8px; background: rgba(0, 0, 0, 0.18); }
html.ui-new .kingdom-list li .k-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-new .kingdom-list li.me { background: rgba(255, 200, 50, 0.16); box-shadow: inset 0 0 0 2px #ffc832; }
html.ui-new .k-dot { width: 12px; height: 12px; border: 2px solid var(--ink); }
html.ui-new .k-persona, html.ui-new .k-you { display: none; }
html.ui-new .k-stats { font-size: 11px; }
html.ui-new .k-score { font-size: 15px; color: #ffe066; }
/* mode panels (Deathmatch score + one-life boosts, the Hill, the waves): the right column under the rank chip */
html.ui-new .right-col .mode-panel, html.ui-new .right-col .boost-bar, html.ui-new .nh-modecol .mode-panel, html.ui-new .nh-modecol .boost-bar { position: static; transform: none; left: auto; top: auto !important; bottom: auto; width: auto; min-width: 0; margin: 0; align-self: stretch; padding: 6px 10px 8px; border-radius: 14px; }
html.ui-new .mode-panel { font-size: 13px; }
html.ui-new .mp-title, html.ui-new .mp-dmt { font: 400 18px var(--font-display); color: var(--cream); text-shadow: var(--nl-out-s); }
html.ui-new .mp-title b { color: #ffe066; }
html.ui-new .mp-line { font-size: 13px; }
html.ui-new .mp-bar { height: 9px; border: 2px solid var(--ink); border-radius: 99px; }
html.ui-new .mp-dm, html.ui-new .right-col .mp-dm { font-size: 13px; padding: 2px 5px; }
html.ui-new .mp-dm b, html.ui-new .mp-crown b { color: #ffe066; }
html.ui-new .boost-bar .bb-row { flex-wrap: wrap; justify-content: center; }
html.ui-new .boost-bar .bb-perk .bb-name, html.ui-new .boost-bar .bb-title .ar { display: none; }
html.ui-new .bb-title { font: 400 13px var(--font-display); color: var(--cream); text-shadow: var(--nl-out-s); }
html.ui-new .bb-buy button { font-size: 12px; padding: 2px 6px; border: 2px solid var(--ink); }
html.ui-new.nh-kopen .right-col .mode-panel, html.ui-new.nh-kopen .right-col .boost-bar { display: none !important; }
html.ui-new .hud.mode-dm #kingdomPanel.nh-open { display: block !important; }
html.ui-new .nh-x { position: absolute; top: 7px; inset-inline-end: 7px; inset-inline-start: auto; width: 32px; height: 32px; border: 3px solid var(--ink); border-radius: 10px; background: linear-gradient(180deg, #46506a, #2b3245); color: var(--cream); font: 400 18px var(--font-display); cursor: pointer; box-shadow: 0 3px 0 var(--ink); z-index: 2; }
/* army: a chip under the player card, its card right under the chip (the bottom-left is the building card's) */
html.ui-new .nh-army { position: absolute; left: 16px; top: 124px; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; border: 3px solid var(--ink); border-radius: 16px; background: rgba(22, 26, 35, 0.7); color: var(--cream); cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
html.ui-new .nh-army.hidden { display: none; }
html.ui-new .nh-army.on { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px #ffc832; }
html.ui-new .nh-army.starving { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px #e5484d; animation: nlBob 0.8s ease-in-out infinite; }
html.ui-new .nh-ai { width: 36px; height: 36px; }
html.ui-new .nh-at { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
html.ui-new .nh-army b { font-size: 20px; }
html.ui-new .nh-army small { font-size: 12px; font-weight: 800; color: var(--dimc); }
html.ui-new #armyPanel { display: none !important; }
html.ui-new #armyPanel.nh-open { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; position: fixed; left: 16px; top: 186px; bottom: auto; right: auto; width: 320px; padding: 8px 10px 10px; z-index: 6; }
html.ui-new #armyPanel .panel-title { grid-column: 1 / 2; margin: 0; min-height: 30px; }
html.ui-new #armyPanel .panel-title span { font-size: 20px; }
html.ui-new #armyPanel .army-row { display: contents; }
html.ui-new .army-count { grid-column: 2 / 4; grid-row: 1; justify-self: end; margin-inline-end: 40px; font-size: 13px; font-weight: 800; color: var(--dimc); white-space: nowrap; }
html.ui-new .army-count strong { font-family: var(--font-display); font-size: 20px; font-weight: 400; color: var(--cream); text-shadow: var(--nl-out-s); }
html.ui-new #armyPanel .stance-toggle { grid-column: 1 / -1; display: flex; border: 0; gap: 6px; overflow: visible; margin: 0; }
html.ui-new .stance-toggle button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 4px 6px; border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, rgba(70, 80, 106, 0.92), rgba(43, 50, 69, 0.92)); color: var(--cream); font: 400 15px var(--font-display); text-shadow: var(--nl-out-s); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 4px 0 var(--ink); }
html.ui-new .stance-toggle button .uic { width: 28px; height: 28px; }
html.ui-new .stance-toggle button.on { background: linear-gradient(180deg, var(--blue1), var(--blue2)); color: var(--cream); }
html.ui-new .army-hint, html.ui-new .army-upkeep { display: none; }
html.ui-new #armyPanel .army-comp { grid-column: 1 / -1; margin: 0; gap: 5px; }
html.ui-new #armyPanel .army-comp:empty { display: none; }
html.ui-new #armyPanel .starve { grid-column: 1 / -1; }
html.ui-new .comp-chip { padding: 1px 7px 1px 1px; border-radius: 9px; border: 2px solid var(--ink); font-size: 13px; }
html.ui-new .comp-chip canvas { width: 26px; height: 26px; }
html.ui-new .nh-attack { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0; height: 44px; border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, var(--red1), var(--red2)); cursor: pointer; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 4px 0 var(--ink); }
html.ui-new .nh-attack .uic { width: 28px; height: 28px; }
html.ui-new .nh-attack span { font-size: 20px; }
/* the building card (opens next to your building): compact, see-through, never taller than about half the screen */
html.ui-new #buildingPanel { left: 16px; bottom: 18px; width: 352px; padding: 9px 11px 11px; max-height: min(400px, calc(var(--vh100) / var(--nz, 1) - 320px)); overflow-y: auto; overscroll-behavior: contain; border-radius: 20px;
  display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-content: start; }
html.ui-new.nh-armyopen #buildingPanel { max-height: calc(var(--vh100) / var(--nz, 1) - 470px); min-height: 130px; }
html.ui-new .bp-head { display: contents; }
html.ui-new #bpIcon { grid-row: 1 / span 2; align-self: center; width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 12px; background: radial-gradient(circle, #6a8fb8, #33506e); }
html.ui-new .bp-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
html.ui-new .bp-name { font-size: 20px; white-space: nowrap; }
html.ui-new .bp-sub { font-size: 11.5px; font-weight: 800; color: var(--dimc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-new .bp-hp { grid-column: 2; height: 15px; margin: 3px 0 0; border: 2px solid var(--ink); border-radius: 99px; background: #11141b; }
html.ui-new .bp-hp i { border-radius: 99px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3); }
html.ui-new .bp-hp span { font-size: 10px; line-height: 11px; }
html.ui-new .bp-info { grid-column: 1 / -1; margin-top: 6px; font-size: 12.5px; color: var(--dimc); }
html.ui-new .bp-info:empty { display: none; }
html.ui-new .bp-actions { grid-column: 1 / -1; gap: 6px; margin-top: 8px; }
html.ui-new .bp-btn { min-height: 38px; padding: 4px 10px; border: 3px solid var(--ink); border-radius: 13px; background: linear-gradient(180deg, rgba(70, 80, 106, 0.94), rgba(43, 50, 69, 0.94)); color: var(--cream); font: 400 15px var(--font-display); text-shadow: var(--nl-out-s); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 3px 0 var(--ink); }
html.ui-new .bp-btn:not(:disabled):hover { filter: brightness(1.1); }
html.ui-new .bp-btn .cost { font: 800 12px var(--font-body); text-shadow: none; color: var(--dimc); }
html.ui-new .bp-btn .cost.lack { color: #ff9b8f; }
html.ui-new .bp-btn.h-up { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
html.ui-new .bp-btn.h-up:not(:disabled) { background: linear-gradient(180deg, var(--green1), var(--green2)); }
html.ui-new .bp-btn.h-up:not(:disabled) .cost { color: #f2ffe6; }
html.ui-new .bp-demolish { min-height: 30px; font-size: 13px; background: linear-gradient(180deg, rgba(90, 58, 58, 0.94), rgba(58, 36, 36, 0.94)); }
html.ui-new .bp-demolish.armed { background: linear-gradient(180deg, var(--red1), var(--red2)); }
/* demolish: a small button in the card's corner (one row less) — the first tap arms it, the second pulls the building down */
html.ui-new #buildingPanel .bp-btn.bp-demolish { position: absolute; top: 8px; inset-inline-end: 10px; inset-inline-start: auto; width: auto; min-height: 28px; padding: 2px 9px; border-width: 2px; border-radius: 10px; z-index: 2; }
html.ui-new #buildingPanel .bp-btn.bp-demolish > span:first-child { display: inline-flex; align-items: center; gap: 4px; font-size: 0; }
html.ui-new #buildingPanel .bp-btn.bp-demolish.armed > span:first-child { font-size: 11px; }
html.ui-new #buildingPanel .bp-btn.bp-demolish .cost { display: none; }
html.ui-new #buildingPanel.h-demo .bp-head > div, html.ui-new #buildingPanel.h-demo .bp-hp { margin-inline-end: 46px; }
html.ui-new .bp-effect { font-size: 12px; color: var(--dimc); font-weight: 800; padding: 0 4px; }
html.ui-new .train-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-height: none; overflow: visible; }
html.ui-new .train-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-height: 0; padding: 4px 2px 5px; border: 3px solid var(--ink); border-radius: 13px; background: linear-gradient(180deg, rgba(58, 67, 88, 0.92), rgba(38, 44, 59, 0.92)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 3px 0 var(--ink); text-align: center; color: var(--cream); }
html.ui-new .train-card canvas { width: 40px; height: 40px; }
html.ui-new .train-card:not(:disabled):hover { filter: brightness(1.12); transform: translateY(-2px); }
html.ui-new .train-card:disabled { opacity: 1; filter: saturate(0.25) brightness(0.72); }
html.ui-new .tc-name { font-size: 12.5px; line-height: 1.1; }
html.ui-new .tc-strong, html.ui-new .tc-weak { display: none; }
html.ui-new .tc-cost { font-size: 11px; display: flex; flex-wrap: wrap; justify-content: center; gap: 1px 5px; }
html.ui-new .tc-cost .ci, html.ui-new .recipe-cost .ci, html.ui-new .bp-btn .cost .ci { margin-right: 0; gap: 1px; }
/* hotbar */
html.ui-new .hotbar-wrap { bottom: 16px; }
html.ui-new .equipped-label { display: none; }
html.ui-new .hotbar { gap: 8px; padding: 8px; border-radius: 22px; }
html.ui-new .slot { width: 68px; height: 72px; border: 3px solid var(--ink); border-radius: 16px; background: linear-gradient(180deg, #46506a, #2b3245); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 4px 0 var(--ink); }
html.ui-new .slot canvas { width: 56px; height: 56px; }
html.ui-new .slot.active { transform: none; background: linear-gradient(180deg, #5a4a1a, #3a2e10); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 4px 0 var(--ink), 0 0 0 3px #ffc832; }
html.ui-new .slot .key { top: -9px; left: -7px; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 7px; background: var(--cream); color: var(--ink); font: 400 13px var(--font-display); box-shadow: 0 2px 0 var(--ink); }
/* the action buttons */
html.ui-new .action-buttons { bottom: 16px; right: 16px; gap: 12px; align-items: flex-end; }
html.ui-new .action-toggle { position: relative; flex-direction: column; justify-content: center; gap: 0; width: 100px; height: 100px; padding: 6px; border: 3px solid var(--ink); border-radius: 24px; font-size: 18px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 6px 0 var(--ink); }
html.ui-new .action-toggle .uic { width: 54px; height: 54px; }
html.ui-new .action-toggle kbd { position: absolute; top: -10px; right: -8px; display: grid; place-items: center; min-width: 26px; height: 24px; padding: 0 4px; border: 2px solid var(--ink); border-radius: 7px; background: var(--cream); color: var(--ink); font: 400 14px var(--font-display); box-shadow: 0 2px 0 var(--ink); }
html.ui-new #buildToggle { background: linear-gradient(180deg, var(--gold1), var(--gold2)); }
html.ui-new #craftToggle { background: linear-gradient(180deg, var(--blue1), var(--blue2)); }
html.ui-new #marketToggle { background: linear-gradient(180deg, var(--orange1), var(--orange2)); }
html.ui-new #clanToggle { background: linear-gradient(180deg, var(--purple1), var(--purple2)); }
html.ui-new .action-toggle.has-craftable { animation: nhPulse 1.6s ease-in-out infinite; }
@keyframes nhPulse { 0%, 100% { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 6px 0 var(--ink), 0 0 0 0 rgba(255, 224, 102, 0.7); } 50% { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 6px 0 var(--ink), 0 0 0 9px rgba(255, 224, 102, 0); } }
html.ui-new .action-toggle[aria-expanded="true"] { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 6px 0 var(--ink), 0 0 0 4px var(--cream); }
/* Build & Craft: a dock at the bottom centre (the hotbar steps aside) — the player and the map stay in sight */
html.ui-new .side-panel { left: 16px; right: calc(var(--nh-acts, 2) * 112px + 18px); top: auto; bottom: 14px; transform: none; margin-inline: auto; width: min(780px, calc(100vw / var(--nz, 1) - 34px - var(--nh-acts, 2) * 112px)); min-width: 0; max-height: min(330px, calc(var(--vh100) / var(--nz, 1) - 340px)); min-height: 0; padding: 8px 12px 12px; border-radius: 22px; z-index: 8; }
html.ui-new #buildPanel:not(.hidden), html.ui-new #craftPanel:not(.hidden) { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 14px; align-items: center; overflow: hidden; }
html.ui-new #buildPanel .panel-title, html.ui-new #craftPanel .panel-title { grid-column: 1; grid-row: 1; margin: 0; min-height: 36px; }
html.ui-new #craftPanel .panel-title { grid-column: 1 / -1; padding-inline-end: 42px; }
html.ui-new .side-panel .panel-title span { font-size: 24px; }
html.ui-new .side-panel .craft-list { grid-column: 1 / -1; grid-row: 2; align-self: stretch; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 4px; padding: 9px 6px 4px; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
html.ui-new .side-panel .recipe { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 4px 7px; border: 3px solid var(--ink); border-radius: 15px; background: linear-gradient(180deg, rgba(58, 67, 88, 0.92), rgba(38, 44, 59, 0.92)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 4px 0 var(--ink); text-align: center; cursor: pointer; }
html.ui-new .side-panel .recipe:hover { filter: brightness(1.1); }
html.ui-new .side-panel .recipe canvas { width: 52px; height: 52px; background: none; }
html.ui-new .side-panel .recipe > div { display: flex; flex-direction: column; align-items: center; }
html.ui-new .recipe-name { font-size: 15px; line-height: 1.1; }
html.ui-new .side-panel .recipe-desc { display: none; }
html.ui-new .side-panel .recipe-cost { justify-content: center; flex-wrap: wrap; font-size: 12.5px; gap: 1px 6px; margin-top: 1px; }
html.ui-new .side-panel .recipe .lockline { font-size: 11px; margin-top: 1px; }
html.ui-new .side-panel .recipe.locked { opacity: 1; filter: saturate(0.2) brightness(0.72); }
html.ui-new .side-panel .btn-craft { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; border-radius: 15px; }
html.ui-new .side-panel .btn-craft:disabled { cursor: not-allowed; }
html.ui-new .side-panel .btn-craft.owned { opacity: 1; inset: auto 6px 6px auto; width: auto; height: auto; padding: 1px 7px; border: 2px solid var(--ink); border-radius: 8px; background: #3fa92a; color: #fff; font: 400 12px var(--font-display); pointer-events: none; }
html.ui-new.nh-side .hotbar-wrap, html.ui-new.touch-play.nh-side #buildingPanel { display: none !important; }
/* a computer: with a building card open, the dock sits right of it (both stay usable) */
html.ui-new.nh-bp:not(.touch-play) .side-panel { left: 384px; width: min(780px, calc(100vw / var(--nz, 1) - 402px - var(--nh-acts, 2) * 112px)); }
html.ui-new .recipe-group { display: none; }
html.ui-new .side-panel .recipe .nh-newb { position: absolute; top: -8px; inset-inline-end: -6px; padding: 0 6px; border: 2px solid var(--ink); border-radius: 8px; background: linear-gradient(180deg, var(--red1), var(--red2)); color: #fff; font: 400 11px/16px var(--font-display); font-style: normal; box-shadow: 0 2px 0 var(--ink); pointer-events: none; z-index: 2; animation: nlBob 1.2s ease-in-out infinite; }
html.ui-new .side-panel .recipe.nh-isnew { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 4px 0 var(--ink), 0 0 0 3px #ff7a6a; }
html.ui-new .nb-tabs { grid-column: 2; grid-row: 1; display: flex; gap: 8px; margin: 6px 42px 0 0; min-width: 0; }
html.ui-new .nb-tabs button { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 8px; border: 3px solid var(--ink); border-radius: 13px; background: rgba(28, 33, 45, 0.92); color: #9aa3b5; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
html.ui-new .nb-tabs button .uic { width: 26px; height: 26px; }
html.ui-new .nb-tabs button span { font-size: 17px; }
html.ui-new .nb-tabs button.on { background: linear-gradient(180deg, #46506a, #2f3648); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 3px 0 var(--ink), 0 0 0 3px #ffc832; }
html.ui-new .nb-n { position: absolute; top: -10px; right: -8px; min-width: 22px; height: 22px; padding: 0 5px; border: 2px solid var(--ink); border-radius: 99px; background: linear-gradient(180deg, var(--green1), var(--green2)); color: #fff; font: 400 13px/18px var(--font-display); font-style: normal; text-align: center; }
html.ui-new .nb-n.hidden { display: none; }
html.ui-new #buildPanel[data-cat="eco"] .recipe:not([data-cat="eco"]), html.ui-new #buildPanel[data-cat="mil"] .recipe:not([data-cat="mil"]), html.ui-new #buildPanel[data-cat="def"] .recipe:not([data-cat="def"]) { display: none; }
/* messages */
html.ui-new .hud .toasts { top: 186px; bottom: auto; flex-direction: column; gap: 6px; max-width: min(620px, calc(100vw / var(--nz, 1) - 760px)); min-width: 300px; }
html.ui-new.tut-on .hud .toasts { top: 214px; }
html.ui-new body.h-notc .hud .toasts, html.ui-new body.h-stealth .hud .toasts { top: 218px; }
html.ui-new .hud .toasts .toast:nth-last-child(n+4) { display: none; }
html.ui-new .toast { border: 3px solid var(--ink); border-radius: 16px; background: rgba(22, 26, 35, 0.86); font-size: 15px; box-shadow: 0 4px 0 var(--ink); text-align: center; }
html.ui-new .hud-ver { display: none; }
html.ui-new .recruit-bar { display: none; }
html.ui-new .bp-info > div:nth-child(n+2) { display: none; }
html.ui-new .nh-lk { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 3px; }
html.ui-new .nh-lk.big { width: 24px; height: 24px; opacity: 0.85; }
html.ui-new .nh-full { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 12px; background: rgba(229, 72, 77, 0.22); font: 400 16px var(--font-display); color: #ffd0cb; text-shadow: var(--nl-out-s); }
html.ui-new .nh-full .uic { width: 28px; height: 28px; flex: none; }
html.ui-new .nh-kbd { display: inline-grid; place-items: center; min-width: 22px; height: 20px; margin-inline-start: 4px; padding: 0 3px; border: 2px solid var(--ink); border-radius: 6px; background: var(--cream); color: var(--ink); font: 400 12px var(--font-display); text-shadow: none; vertical-align: 2px; }
html.ui-new .recipe .lockline { display: flex; align-items: center; justify-content: center; color: #ffcf8a; }
html.ui-new .bp-effect:not(.bp-branch-title) { display: none; }

/* =====================================================================
 * MATCH HUD — phones & tablets (the HUD is drawn for a 390 px tall screen)
 * ===================================================================== */
html.ui-new.dev-touch.touch-play .hud { zoom: calc(var(--ui) * var(--pz, 1)); --zf: calc(var(--ui) * var(--pz, 1)); }
html.ui-new.touch-play #playerCard { top: 6px; left: 8px; min-width: 0; padding: 3px 12px 3px 3px; gap: 8px; border-radius: 18px; }
html.ui-new.touch-play #avatarCanvas { width: 44px; height: 44px; border-width: 2px; box-shadow: 0 0 0 2px #ffc832; }
html.ui-new.touch-play .player-name { font-size: 15px; margin-bottom: 3px; max-width: 120px; }
html.ui-new.touch-play .hp-bar { height: 18px; border-width: 2px; min-width: 120px; }
html.ui-new.touch-play .hp-text { font-size: 12px; }
html.ui-new.touch-play #playerCard .eat-btn { display: none !important; }
html.ui-new.touch-play #resourceBar { top: 5px; padding: 3px 8px; gap: 2px; border-radius: 16px; }
html.ui-new.touch-play .res { min-width: 0; padding: 0 6px 0 0; gap: 3px; }
html.ui-new.touch-play .res-icon { width: 26px; height: 26px; }
html.ui-new.touch-play .res-count { font-size: 19px; }
html.ui-new.touch-play #matchBar { top: 50px; padding: 0 10px; gap: 6px; }
html.ui-new.touch-play #mbClockText { display: none; }
html.ui-new.touch-play #matchBar svg { width: 16px; height: 16px; }
html.ui-new.touch-play .mb-timer { font-size: 16px; }
html.ui-new.touch-play #nhGoal { top: 80px; padding: 2px 12px 2px 4px; gap: 6px; max-width: 360px; }
html.ui-new.touch-play .nh-gi { width: 28px; height: 28px; }
html.ui-new.touch-play .nh-gt, html.ui-new.touch-play .nh-gn { font-size: 15px; }
html.ui-new.touch-play .right-col { top: 6px; right: 8px; width: 112px; gap: 6px; max-height: none; overflow: visible; zoom: 1; --zf: 1; }
html.ui-new.touch-play #minimap { width: 100px; height: 100px; border-radius: 12px; }
html.ui-new.touch-play .minimap-wrap { padding: 4px; border-radius: 16px; }
html.ui-new.touch-play #nhMenu { top: 6px; right: 128px; width: 44px; height: 44px; padding: 7px; border-radius: 13px; }
html.ui-new.touch-play .nh-rank { padding: 3px 8px; gap: 4px; border-radius: 11px; }
html.ui-new.touch-play .nh-rank .uic { width: 20px; height: 20px; }
html.ui-new.touch-play .nh-rank b { font-size: 16px; }
html.ui-new.touch-play .nh-rank small { font-size: 12px; }
/* kingdoms & army: one card at a time, top-left under the player card (clear of the stick below) */
html.ui-new.touch-play #kingdomPanel.nh-open { display: block !important; position: fixed; left: 8px; right: auto; top: 70px; width: 224px; padding: 5px 7px 7px; z-index: 32; }
html.ui-new.touch-play #kingdomPanel .panel-title { min-height: 24px; margin-bottom: 3px; padding-inline-end: 30px; }
html.ui-new.touch-play #kingdomPanel .panel-title span { font-size: 15px; }
html.ui-new.touch-play #kingdomList { gap: 2px; min-height: 0; max-height: min(110px, calc(var(--vh100) / var(--pz, 1) - 270px)); overflow-y: auto; }
html.ui-new.touch-play .kingdom-list li { grid-template-columns: 14px 10px minmax(0, 1fr) auto; gap: 5px; font-size: 12px; padding: 2px 5px; border-radius: 7px; }
html.ui-new.touch-play .k-dot { width: 10px; height: 10px; }
html.ui-new.touch-play .k-score { font-size: 13px; }
html.ui-new.touch-play .k-stats { display: none; }
html.ui-new.touch-play .nh-army { display: none !important; }
/* mode panels on touch: top-left under the player card (the army / kingdoms card takes their place while open) */
html.ui-new .nh-modecol { display: none; }
html.ui-new.touch-play .nh-modecol { position: absolute; left: 8px; top: 70px; display: flex; flex-direction: column; gap: 6px; width: 214px; pointer-events: auto; }
html.ui-new.touch-play.nh-armyopen .nh-modecol, html.ui-new.touch-play.nh-kopen .nh-modecol { display: none; }
html.ui-new.touch-play .nh-modecol .mode-panel, html.ui-new.touch-play .nh-modecol .boost-bar { padding: 4px 8px 6px; border-radius: 12px; }
html.ui-new.touch-play .nh-modecol .boost-bar .bb-title { display: none; }
html.ui-new.touch-play .mp-title, html.ui-new.touch-play .mp-dmt { font-size: 14px; margin-bottom: 2px; }
html.ui-new.touch-play .mp-line, html.ui-new.touch-play .mp-dm, html.ui-new.touch-play .nh-modecol .mp-dm { font-size: 11px; }
html.ui-new.touch-play .nh-modecol .bb-row { gap: 4px; }
html.ui-new.touch-play .nh-modecol .bb-perk { padding: 2px 4px; gap: 2px; }
html.ui-new.touch-play .nh-modecol .bb-perk .bb-ico svg { width: 15px; height: 15px; }
html.ui-new.touch-play .nh-modecol .bb-buy button { font-size: 10.5px; padding: 1px 4px; }
html.ui-new.touch-play #armyPanel.nh-open { left: 8px; top: 70px; bottom: auto; width: 272px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 5px 7px 7px; z-index: 32; }
html.ui-new.touch-play #armyPanel .panel-title { grid-column: 1 / 3; min-height: 24px; }
html.ui-new.touch-play #armyPanel .panel-title span { font-size: 15px; }
html.ui-new.touch-play .army-count { grid-column: 3 / 5; margin-inline-end: 32px; font-size: 11px; }
html.ui-new.touch-play .army-count strong { font-size: 16px; }
html.ui-new.touch-play #armyPanel .stance-toggle { grid-column: 1 / 4; grid-row: 2; gap: 5px; }
html.ui-new.touch-play .stance-toggle button { font-size: 12px; padding: 3px 2px 4px; border-radius: 11px; border-width: 2px; }
html.ui-new.touch-play .stance-toggle button .uic { width: 22px; height: 22px; }
html.ui-new.touch-play .nh-attack { grid-column: 4; grid-row: 2; flex-direction: column; gap: 0; height: 100%; min-height: 44px; border-width: 2px; border-radius: 11px; }
html.ui-new.touch-play .nh-attack .uic { width: 22px; height: 22px; }
html.ui-new.touch-play .nh-attack span { font-size: 12px; }
html.ui-new.touch-play .comp-chip { font-size: 11px; padding: 0 5px 0 0; border-radius: 7px; }
html.ui-new.touch-play .comp-chip canvas { width: 20px; height: 20px; }
html.ui-new.touch-play .nh-x { width: 26px; height: 26px; font-size: 13px; top: 4px; inset-inline-end: 4px; border-radius: 8px; border-width: 2px; }
/* the building card on a phone: a low strip between the stick and the thumb buttons — one row of tiles that scrolls sideways */
html.ui-new.touch-play #buildingPanel { width: max-content; min-width: 230px; display: flex; flex-direction: column; align-items: stretch; column-gap: 8px; padding: 5px 7px 6px; border-radius: 15px; overflow: hidden; }
html.ui-new.touch-play .bp-head { display: flex; align-items: center; gap: 8px; }
html.ui-new.touch-play #buildingPanel.h-demo .bp-head { margin-inline-end: 46px; }
html.ui-new.touch-play #buildingPanel.h-demo .bp-head > div, html.ui-new.touch-play #buildingPanel.h-demo .bp-hp { margin-inline-end: 0; }
html.ui-new.touch-play #bpIcon { flex: none; width: 24px; height: 24px; border-width: 2px; border-radius: 7px; }
html.ui-new.touch-play .bp-name { font-size: 15px; }
html.ui-new.touch-play .bp-sub, html.ui-new.touch-play .bp-info, html.ui-new.touch-play .bp-effect, html.ui-new.touch-play .bp-hp span { display: none; }
html.ui-new.touch-play .bp-hp { flex: 1 1 60px; height: 10px; margin: 0; border-width: 2px; min-width: 60px; }

html.ui-new.touch-play #buildingPanel .bp-actions { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 5px; margin-top: 5px; padding: 1px 1px 4px; max-height: none; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
html.ui-new.touch-play .bp-actions::-webkit-scrollbar { display: none; }
html.ui-new.touch-play #buildingPanel .bp-actions > *, html.ui-new.touch-play #buildingPanel .train-card { flex: none; }
html.ui-new.touch-play .train-grid { display: contents; }
html.ui-new.touch-play #buildingPanel .train-card { width: 64px; min-height: 74px; padding: 3px 2px 4px; border-width: 2px; border-radius: 11px; }
html.ui-new.touch-play .train-card canvas { width: 34px; height: 34px; }
html.ui-new.touch-play .tc-name { font-size: 10.5px; }
html.ui-new.touch-play .tc-cost { font-size: 9.5px; gap: 0 3px; }
html.ui-new.touch-play .bp-btn { flex-direction: column; justify-content: center; align-items: center; gap: 2px; width: 92px; min-height: 74px; padding: 3px 5px; border-width: 2px; border-radius: 11px; font-size: 11px; line-height: 1.1; text-align: center; }
html.ui-new.touch-play .bp-btn > span:first-child { display: block; font-size: inherit; }
html.ui-new.touch-play .building-panel .bp-btn span { font-size: inherit; }
html.ui-new.touch-play .building-panel .bp-btn .cost, html.ui-new.touch-play .building-panel .bp-btn .cost span { font-size: 9.5px; }
html.ui-new.touch-play .bp-btn .cost { display: flex; flex-wrap: wrap; justify-content: center; font-size: 9.5px; gap: 0 3px; }
html.ui-new.touch-play .nh-kbd { display: none; }
html.ui-new.touch-play .nh-full { flex-direction: column; justify-content: center; width: 64px; min-height: 74px; padding: 3px; gap: 2px; border-radius: 11px; font-size: 10px; line-height: 1.05; text-align: center; }
html.ui-new.touch-play .nh-full .uic { width: 22px; height: 22px; }
/* Build & Craft on a phone: the same low strip — tabs on top, one row of tiles that scrolls sideways */
html.ui-new.touch-play .side-panel { transform: none; min-width: 0; padding: 4px 7px 6px; border-radius: 15px; }
html.ui-new.touch-play #buildPanel:not(.hidden), html.ui-new.touch-play #craftPanel:not(.hidden) { grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; }
html.ui-new.touch-play #buildPanel .panel-title { display: none; }
html.ui-new.touch-play #craftPanel .panel-title { min-height: 26px; }
html.ui-new.touch-play .side-panel .panel-title span { font-size: 15px; }
html.ui-new.touch-play .side-panel .craft-list { display: flex; flex-wrap: nowrap; gap: 5px; margin-top: 0; padding: 8px 6px 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
html.ui-new.touch-play .side-panel .craft-list::-webkit-scrollbar { display: none; }
html.ui-new.touch-play .side-panel .recipe { flex: none; width: 76px; padding: 3px 2px 4px; border-width: 2px; border-radius: 11px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 3px 0 var(--ink); }
html.ui-new.touch-play .side-panel .recipe canvas { width: 34px; height: 34px; }
html.ui-new.touch-play .recipe-name { font-size: 10.5px; }
html.ui-new.touch-play .side-panel .recipe-cost, html.ui-new.touch-play .side-panel .recipe .recipe-cost { flex-wrap: nowrap; font-size: 9.5px; gap: 0 4px; }
html.ui-new.touch-play .side-panel .recipe .lockline, html.ui-new.touch-play .nh-lv { font-size: 9px; }
html.ui-new.touch-play .side-panel .btn-craft.owned { font-size: 9.5px; padding: 0 4px; inset: auto 3px 3px auto; }
html.ui-new.touch-play .nb-tabs { grid-column: 1 / -1; gap: 5px; margin: 2px 30px 0 0; }
html.ui-new.touch-play .nb-tabs button { padding: 2px 9px 2px 5px; border-width: 2px; border-radius: 10px; }
html.ui-new.touch-play .nb-tabs button .uic { width: 18px; height: 18px; }
html.ui-new.touch-play .nb-tabs button span { font-size: 12px; }
html.ui-new.touch-play .nb-n { top: -7px; right: -6px; min-width: 17px; height: 17px; font-size: 10px; line-height: 13px; }
html.ui-new.touch-play .hotbar-wrap { bottom: 6px; }
html.ui-new.touch-play .hotbar { gap: 6px; padding: 5px; border-radius: 16px; }
html.ui-new.touch-play .slot { width: 50px; height: 52px; border-radius: 12px; }
html.ui-new.touch-play .slot canvas { width: 40px; height: 40px; }
html.ui-new.touch-play .slot .key { display: none; }
/* the thumb buttons: chunky, coloured, few */
html.ui-new #touchUI .t-pause, html.ui-new #touchUI .t-full, html.ui-new #touchUI [data-act="order"] { display: none !important; }
/* touch: the thumb buttons do Build / Craft (Market opens from its building card) — no computer buttons over them */
html.ui-new.touch-play .action-buttons { display: none !important; }
html.ui-new:not(.nh-use) #touchUI [data-act="interact"], html.ui-new:not(.nh-hurt) #touchUI [data-act="eat"], html.ui-new.nh-autotool #touchUI [data-act="nextTool"] { display: none !important; }
html.ui-new.dev-touch .touch-ui .t-btns .t-btn { border: 3px solid var(--ink); background: linear-gradient(180deg, #46506a, #2b3245); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--ink), 0 6px 12px rgba(0, 0, 0, 0.35); color: var(--cream); }
html.ui-new.dev-touch .touch-ui .t-btns .t-btn .tb-l { font: 400 calc(10px * var(--tk, 1)) / 1 var(--font-display); text-shadow: var(--nl-out-s); opacity: 1; }
html.ui-new.dev-touch .touch-ui .t-btns [data-act="build"] { background: linear-gradient(180deg, var(--gold1), var(--gold2)); }
html.ui-new.dev-touch .touch-ui .t-btns [data-act="stance"] { background: linear-gradient(180deg, var(--blue1), var(--blue2)); }
html.ui-new.dev-touch .touch-ui .t-btns [data-act="craft"] { background: linear-gradient(180deg, var(--teal1), var(--teal2)); }
html.ui-new.dev-touch .touch-ui .t-btns [data-act="interact"] { background: linear-gradient(180deg, var(--green1), var(--green2)); animation: nlBob 1.2s ease-in-out infinite; }
html.ui-new.dev-touch .touch-ui .t-btns [data-act="eat"] { background: linear-gradient(180deg, var(--red1), var(--red2)); animation: nlBob 1.2s ease-in-out infinite; }
html.ui-new.dev-touch .touch-ui .t-btns .t-btn.down { transform: translateY(3px) scale(0.95); box-shadow: 0 1px 0 var(--ink); }
html.ui-new.dev-touch .touch-ui .tz-aim .stick.atk-btn { border: 4px solid var(--ink); opacity: 1; background: radial-gradient(circle at 40% 30%, var(--red1), var(--red2)); box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35), 0 5px 0 var(--ink), 0 8px 16px rgba(0, 0, 0, 0.4); }
html.ui-new.dev-touch .touch-ui .tz-aim .stick.atk-btn.has-target { box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35), 0 5px 0 var(--ink), 0 0 0 4px #ffe066; }
html.ui-new.dev-touch .touch-ui .stick:not(.aim) { border: 3px solid rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.16); }
html.ui-new.dev-touch .touch-ui .stick:not(.aim) i { background: rgba(255, 248, 230, 0.9); border: 3px solid var(--ink); }
/* the phone rules of the classic HUD hid these: the new UI shows them on demand */
html.ui-new.touch-play #armyPanel.nh-open .panel-title, html.ui-new.touch-play #armyPanel.nh-open .stance-toggle, html.ui-new.touch-play #armyPanel.nh-open .army-comp { display: flex !important; }
html.ui-new.touch-play.nh-bp .hotbar-wrap { display: none; }
/* messages on a phone: under the goal, above every card */
html.ui-new.touch-play .hud .toasts { top: 124px; min-width: 0; max-width: 380px; }
/* narrow screens (the HUD drawn under ~820 units wide: small phones, tablets): the top row tightens, and an open
   army / kingdoms card takes the goal's place (messages move right of it) */
html.ui-new.touch-play.nh-narrow .player-name { max-width: 92px; }
html.ui-new.touch-play.nh-narrow .hp-bar { min-width: 92px; }
html.ui-new.touch-play.nh-narrow #resourceBar { padding: 2px 6px; }
html.ui-new.touch-play.nh-narrow .res-icon { width: 22px; height: 22px; }
html.ui-new.touch-play.nh-narrow .res-count { font-size: 16px; }
html.ui-new.touch-play.nh-narrow.nh-armyopen #nhGoal, html.ui-new.touch-play.nh-narrow.nh-kopen #nhGoal { visibility: hidden; }
html.ui-new.touch-play.nh-narrow.nh-armyopen .hud .toasts, html.ui-new.touch-play.nh-narrow.nh-kopen .hud .toasts { left: 292px; transform: none; max-width: calc(100vw / var(--pz, 1) - 420px); }
html.ui-new.touch-play .hud .toasts .toast:nth-last-child(n+3) { display: none; }
html.ui-new.touch-play.tut-on .hud .toasts { top: 126px; }
html.ui-new.touch-play body.h-notc .hud .toasts, html.ui-new.touch-play body.h-stealth .hud .toasts { top: 146px; }
html.ui-new.touch-play .toast { font-size: 12.5px; padding: 4px 12px; border-width: 2px; border-radius: 12px; }

/* =====================================================================
 * Pop-ups in the match (pause, market, cards, end, death, badges)
 * ===================================================================== */
html.ui-new .pause-card, html.ui-new .market-card, html.ui-new .settings-card, html.ui-new #endOverlay .end-card {
  background: linear-gradient(180deg, var(--slate1), var(--slate2)); border: 3px solid var(--ink); border-radius: 24px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 6px 0 var(--ink), 0 20px 40px rgba(0, 0, 0, 0.45); backdrop-filter: none;
}
html.ui-new .pause-overlay { background: rgba(8, 10, 16, 0.55); }
html.ui-new .pause-card { width: min(400px, 92vw); padding: 20px 26px 22px; gap: 12px; }
html.ui-new .pause-card h2 { font: 400 40px var(--font-display); color: var(--cream); text-shadow: var(--nl-out); margin: 0; }
html.ui-new .pause-sub { font-size: 14px; font-weight: 800; color: var(--dimc); }
html.ui-new .pause-card .btn-primary, html.ui-new .pause-card .btn-ghost {
  width: 100%; min-height: 60px; border: 3px solid var(--ink); border-radius: 18px; font: 400 26px var(--font-display); color: var(--cream); text-shadow: var(--nl-out-s);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 5px 0 var(--ink);
}
html.ui-new #btnResume { min-height: 76px; font-size: 34px; background: linear-gradient(180deg, var(--green1), var(--green2)); }
html.ui-new #btnPauseSettings { background: linear-gradient(180deg, #46506a, #2b3245); }
html.ui-new #btnLeave { background: linear-gradient(180deg, var(--red1), var(--red2)); }
html.ui-new .pause-note { font-size: 13px; font-weight: 800; color: var(--dimc); }
html.ui-new .pause-ver { display: none; }
/* market */
html.ui-new .market-card { width: min(660px, 96vw); padding: 16px 20px 20px; }
html.ui-new .market-head h2 { font: 400 36px var(--font-display); color: var(--cream); text-shadow: var(--nl-out); margin: 0; }
html.ui-new .market-sub { display: none; }
html.ui-new .market-gold { font: 400 28px var(--font-display); text-shadow: var(--nl-out-s); }
html.ui-new .market-gold .res-icon { width: 36px; height: 36px; }
html.ui-new .mk-row { padding: 10px 12px; border: 3px solid var(--ink); border-radius: 18px; background: rgba(0, 0, 0, 0.22); box-shadow: 0 4px 0 var(--ink); }
html.ui-new .mk-row .res-icon { width: 46px; height: 46px; }
html.ui-new .mk-name { font: 400 24px var(--font-display); color: var(--cream); text-shadow: var(--nl-out-s); }
html.ui-new .mk-stock { font-size: 13px; }
html.ui-new .mk-row canvas.spark { display: none; }
html.ui-new .mk-btn { min-height: 52px; min-width: 128px; border: 3px solid var(--ink); border-radius: 15px; font: 400 21px var(--font-display); text-shadow: var(--nl-out-s); color: var(--cream) !important; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 4px 0 var(--ink) !important; }
html.ui-new .mk-btn.buy { background: linear-gradient(180deg, var(--green1), var(--green2)); }
html.ui-new .mk-btn.sell { background: linear-gradient(180deg, var(--red1), var(--red2)); }
html.ui-new .mk-btn small { font-size: 13px; color: var(--cream); }
html.ui-new .mk-btn:disabled { filter: saturate(0.2) brightness(0.75); }
html.ui-new #mkClose, html.ui-new #settingsClose, html.ui-new #shopClose { width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 13px; background: linear-gradient(180deg, #46506a, #2b3245); box-shadow: 0 4px 0 var(--ink); color: var(--cream); }
/* level-up cards */
html.ui-new .card-title { font: 400 64px var(--font-display); color: var(--gold1); text-shadow: var(--nl-out); }
html.ui-new .card-sub, html.ui-new .card-legend { font-size: 16px; font-weight: 800; }
/* end of the match */
html.ui-new #endOverlay .end-card h2 { font-size: 58px; text-shadow: var(--nl-out); }
html.ui-new #endOverlay .btn-primary { min-height: 58px; border: 3px solid var(--ink); border-radius: 18px; font: 400 24px var(--font-display); text-shadow: var(--nl-out-s); color: var(--cream); background: linear-gradient(180deg, var(--gold1), var(--gold2)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 5px 0 var(--ink); }
html.ui-new #endOverlay .btn-primary.alt { background: linear-gradient(180deg, #46506a, #2b3245); }
html.ui-new #btnNextStage { background: linear-gradient(180deg, var(--green1), var(--green2)) !important; }
/* death */
html.ui-new .death-card h2 { font-size: 60px; text-shadow: var(--nl-out); }
html.ui-new .death-timer span { font-family: var(--font-display); text-shadow: var(--nl-out); }
/* small badges become clear warnings */
html.ui-new .notc-badge { top: 170px; bottom: auto; height: auto; padding: 6px 14px; border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, var(--red1), var(--red2)); color: #fff; font: 400 17px var(--font-display); text-shadow: var(--nl-out-s); box-shadow: 0 4px 0 var(--ink); }
html.ui-new.touch-play .notc-badge { top: 112px; bottom: auto; font-size: 13px; padding: 3px 10px; }
/* settings: bigger tabs and rows */
html.ui-new .settings-card { width: min(820px, 96vw); }
html.ui-new #settingsTitle { font: 400 34px var(--font-display); text-shadow: var(--nl-out); }
html.ui-new #settingsTabs button { min-height: 44px; padding: 6px 16px; border: 3px solid var(--ink); border-radius: 14px; background: #1c212d; color: #b5bdcc; font: 400 17px var(--font-display); }
html.ui-new #settingsTabs button[aria-selected="true"], html.ui-new #settingsTabs button.on { background: linear-gradient(180deg, var(--gold1), var(--gold2)); color: #3a2200; }
html.ui-new .settings-body { font-size: 15px; }
html.ui-new .settings-body h4 { font: 400 20px var(--font-display); }

/* =====================================================================
 * The academy (first match) in the new UI: one chunky pill under the
 * resources — big icon, 2–3 words, the gesture as pictures, a counter.
 * The cards open below it, never over it.
 * ===================================================================== */
html.ui-new .tut-goal { top: 124px !important; width: auto; max-width: min(720px, calc(100vw / var(--nz, 1) - 40px)); grid-template-columns: 58px auto auto auto auto; gap: 12px; padding: 6px 14px 10px 6px;
  border: 3px solid var(--ink); border-radius: 22px; background: linear-gradient(180deg, rgba(60, 48, 16, 0.94), rgba(36, 28, 10, 0.94)); box-shadow: 0 5px 0 var(--ink), 0 0 0 3px #ffc832, 0 12px 24px rgba(0, 0, 0, 0.35); backdrop-filter: none; }
html.ui-new .tut-goal.tg-alert { background: linear-gradient(180deg, rgba(110, 30, 26, 0.95), rgba(60, 14, 12, 0.95)); box-shadow: 0 5px 0 var(--ink), 0 0 0 3px #ff6a5a, 0 0 30px rgba(255, 90, 74, 0.6); }
html.ui-new .tg-ico { width: 58px; height: 58px; border: 3px solid var(--ink); border-radius: 16px; background: radial-gradient(circle, #6c8f4a, #2f4a25); }
html.ui-new .tg-ico svg { width: 42px; height: 42px; }
html.ui-new .tg-main { flex-direction: row; align-items: center; gap: 14px; }
html.ui-new .tg-main b { font-size: 26px; color: var(--cream); text-shadow: var(--nl-out-s); white-space: nowrap; }
html.ui-new .tut-goal.tg-alert .tg-main b { color: #ffd0cb; }
html.ui-new .tg-main small { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--cream); white-space: nowrap; }
html.ui-new .tg-main small .pg { transform: scale(1.18); }
html.ui-new .tg-prog { font-size: 28px; color: #ffe066; text-shadow: var(--nl-out-s); }
html.ui-new .tg-step { font: 400 15px var(--font-display); color: var(--dimc); }
html.ui-new .tg-skip { align-self: center; width: 32px; height: 32px; border: 2px solid var(--ink); background: rgba(0, 0, 0, 0.35); color: var(--cream); }
html.ui-new .tut-goal .tut-bar { height: 5px; background: rgba(0, 0, 0, 0.35); }
html.ui-new .tut-goal .tut-bar i { background: linear-gradient(90deg, #ffe066, #8ee04f); }
html.ui-new .tut-banner b { font-family: var(--font-display); text-shadow: var(--nl-out); }
html.ui-new.touch-play .tut-goal { top: 74px !important; grid-template-columns: 40px auto auto auto auto; gap: 8px; padding: 3px 10px 7px 3px; border-radius: 16px; max-width: 520px; }
html.ui-new.touch-play .tg-ico { width: 40px; height: 40px; border-radius: 12px; }
html.ui-new.touch-play .tg-ico svg { width: 28px; height: 28px; }
html.ui-new.touch-play .tg-main b { font-size: 18px; }
html.ui-new.touch-play .tg-main small .pg { transform: none; }
html.ui-new.touch-play .tg-prog { font-size: 19px; }
html.ui-new.touch-play .tg-step { display: none; }
html.ui-new.touch-play .tg-skip { width: 26px; height: 26px; }
html.ui-new .nh-lv { display: inline-flex; align-items: center; gap: 4px; color: #ffcf8a; font-size: 13px; font-weight: 900; }
html.ui-new .nh-lv .uic { width: 16px; height: 16px; }

/* =====================================================================
 * The big menus (Shop, Locker, Ranks, Royal Pass, Story): the same chunky
 * frame, outlined titles and fat tabs as the rest of the new UI
 * ===================================================================== */
html.ui-new .shop-card, html.ui-new .ps-card, html.ui-new .cq-card {
  border: 3px solid var(--ink); border-radius: 24px; backdrop-filter: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 6px 0 var(--ink), 0 20px 40px rgba(0, 0, 0, 0.45);
}
html.ui-new .shop-card { background: linear-gradient(180deg, var(--slate1), var(--slate2)); }
html.ui-new .shop-head h2, html.ui-new .ps-title h2, html.ui-new .cq-top h2 { color: var(--cream); text-shadow: var(--nl-out); letter-spacing: 0.4px; }
html.ui-new .ps-title h2, html.ui-new .cq-top h2 { color: #ffe08a; }
html.ui-new .shop-tabs { gap: 8px; }
html.ui-new .shop-tabs button { min-height: 38px; padding: 5px 14px; border: 3px solid var(--ink); border-radius: 13px; background: linear-gradient(180deg, #46506a, #2b3245); color: var(--cream); font: 400 15px var(--font-display); text-shadow: var(--nl-out-s); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), 0 3px 0 var(--ink); }
html.ui-new .shop-tabs button.on { background: linear-gradient(180deg, var(--gold1), var(--gold2)); border-color: var(--ink); color: #3a2200; text-shadow: none; }
html.ui-new .shop-tabs button.tab-hot::after { border: 2px solid var(--ink); font-family: var(--font-display); font-weight: 400; }
html.ui-new.touch-play .shop-tabs button, html.ui-new.dev-touch .shop-tabs button { min-height: 32px; padding: 3px 10px; font-size: 13px; border-width: 2px; }

/* v1.4.1 full-screen invite in the new lobby: a small pill at the top centre (icon + one button, no sentence) */
html.ui-new .full-hint { top: max(8px, env(safe-area-inset-top, 0px)); bottom: auto !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important; animation-name: fhIn; padding: 5px 6px 5px 12px; gap: 8px; font-size: 13px; }
html.ui-new .full-hint .fh-txt { display: none; }
html.ui-new .full-hint .fh-ico { font-size: 18px; }
html.ui-new .full-hint .fh-go { animation: fhPulse 1.6s ease-in-out infinite; }
@keyframes fhPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(255, 210, 74, 0); } }
/* v1.4.1 Achievements while the Shop is locked: the list alone · the trophy / rank chip: our site only */
#shopModal.sh-solo #shopTabs, #shopModal.sh-solo .w-shards { display: none !important; }
html.portal #nlTrophy { display: none !important; }

/* v1.4.1 the end screen: what the new Kingdom Level opens — picture tiles that pop in one by one */
.km-unl { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.km-unl-h { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 999px; background: linear-gradient(180deg, #7ee05a, #2f8f2a); border: 2px solid #1d1a17; box-shadow: 0 3px 0 #1d1a17; animation: kmUpPop .5s cubic-bezier(.2, 1.5, .4, 1) .9s backwards; }
.km-unl-h .uic { width: 18px; height: 18px; }
.km-unl-h b { font-family: var(--font-display, sans-serif); font-size: 16px; color: #fff; text-shadow: 0 2px 0 #1d1a17; letter-spacing: 0.02em; }
.km-unl-l { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.km-ut { display: grid; justify-items: center; gap: 3px; width: 78px; padding: 6px 4px 5px; border-radius: 14px; border: 2px solid #1d1a17; background: radial-gradient(circle at 50% 30%, rgba(255, 224, 102, 0.28), rgba(0, 0, 0, 0.3)); box-shadow: 0 3px 0 #1d1a17, 0 0 18px rgba(255, 210, 74, 0.35); animation: kmUt .55s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.km-ut:nth-child(1) { animation-delay: 1s; } .km-ut:nth-child(2) { animation-delay: 1.12s; } .km-ut:nth-child(3) { animation-delay: 1.24s; }
.km-ut:nth-child(4) { animation-delay: 1.36s; } .km-ut:nth-child(5) { animation-delay: 1.48s; } .km-ut:nth-child(n+6) { animation-delay: 1.6s; }
.km-up-ic { display: grid; place-items: center; width: 44px; height: 44px; }
.km-up-ic .uic, .km-up-ic svg { width: 40px; height: 40px; }
.km-up-ic img { width: 46px; height: 46px; object-fit: contain; }
.km-ut b { font-size: 11.5px; line-height: 1.1; text-align: center; color: #fff8e6; font-weight: 900; }
@keyframes kmUt { from { opacity: 0; transform: scale(0.3) rotate(-8deg); } to { opacity: 1; transform: none; } }
.end-card.ec-tight .km-ut { width: 64px; padding: 4px 3px; } .end-card.ec-tight .km-up-ic { width: 34px; height: 34px; } .end-card.ec-tight .km-up-ic .uic, .end-card.ec-tight .km-up-ic svg { width: 30px; height: 30px; } .end-card.ec-tight .km-up-ic img { width: 36px; height: 36px; }
/* v1.4.1 the Guide in a real match: the Academy's chip, a size smaller (the battlefield stays in view); toasts below it */
html.ui-new.guide-on .hud .toasts { top: 200px; }
html.ui-new.touch-play.guide-on .hud .toasts { top: 122px; }
html.ui-new .gd-goal { grid-template-columns: 48px auto auto auto auto; gap: 10px; padding: 4px 12px 8px 4px; border-radius: 18px; }
html.ui-new .gd-goal .tg-ico { width: 48px; height: 48px; border-radius: 13px; }
html.ui-new .gd-goal .tg-ico svg { width: 34px; height: 34px; }
html.ui-new .gd-goal .tg-main b { font-size: 22px; }
html.ui-new .gd-goal .tg-prog { font-size: 24px; }
html.ui-new.touch-play .gd-goal { grid-template-columns: 36px auto auto auto auto; gap: 7px; padding: 2px 8px 6px 2px; }
html.ui-new.touch-play .gd-goal .tg-ico { width: 36px; height: 36px; }
html.ui-new.touch-play .gd-goal .tg-ico svg { width: 26px; height: 26px; }
html.ui-new.touch-play .gd-goal .tg-main b { font-size: 16px; white-space: nowrap; }
html.ui-new.touch-play .gd-goal .tg-prog { font-size: 17px; }

/* ===== v1.4.2 everything visual in a match: icons and numbers, two words at most ===== */
/* the goal pill: icon · two words · a number (or a small bar) · a ✓ flash when one is done */
html.ui-new .nh-gbar { position: relative; flex: none; width: 74px; height: 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); border: 2px solid var(--ink); overflow: hidden; }
html.ui-new .nh-gbar.hidden { display: none; }
html.ui-new .nh-gbar > i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #ffe066, #f2a93b); transition: width .4s; }
html.ui-new #nhGoal.nh-gok::after { content: '✓'; position: absolute; inset-inline-end: -12px; top: -12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #2fbf4a; color: #fff; font: 900 17px/1 var(--font-body, sans-serif); border: 2px solid #0d2a12; animation: gdOk .9s ease-out both; pointer-events: none; }
html.ui-new.touch-play .nh-gbar { width: 52px; height: 8px; }
/* the army chip: the stance is a picture */
html.ui-new .nh-at { flex-direction: row; align-items: center; gap: 6px; }
html.ui-new #nhArmyS { display: inline-grid; place-items: center; }
html.ui-new #nhArmyS .uic { width: 24px; height: 24px; }
html.ui-new.touch-play #nhArmyS .uic { width: 18px; height: 18px; }
/* messages as pictures: [icon] +n / ✓ / ✗ */
html.ui-new .toast.tv { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; min-height: 0; font-size: 20px; }
html.ui-new .toast.tv .tv-p { display: inline-flex; align-items: center; gap: 2px; }
html.ui-new .toast.tv .tv-p .uic, html.ui-new .toast.tv .tv-h .uic { width: 30px; height: 30px; }
html.ui-new .toast.tv .tv-p img { width: 36px; height: 36px; object-fit: contain; }
html.ui-new .toast.tv .tv-h { display: inline-flex; align-items: center; gap: 4px; }
html.ui-new .toast.tv b { font-family: var(--font-display, sans-serif); font-weight: 400; color: #fff8e6; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
html.ui-new .toast.tv.error b { color: #ffb4b4; }
html.ui-new.touch-play .toast.tv { font-size: 15px; gap: 5px; padding: 2px 10px 2px 4px; }
html.ui-new.touch-play .toast.tv .tv-p .uic, html.ui-new.touch-play .toast.tv .tv-h .uic { width: 22px; height: 22px; }
html.ui-new.touch-play .toast.tv .tv-p img { width: 26px; height: 26px; }
/* the building card in pictures: ★ tier · icon chips · ⬆ T2 / 🔒🏰2 buttons; the explanation lines are gone */
html.ui-new .bp-sub { color: #ffd84a !important; letter-spacing: 1px; font-weight: 900; }
html.ui-new .bp-info { display: flex; flex-wrap: wrap; gap: 6px; font-size: 15px; color: var(--cream); }
html.ui-new .bp-info .nh-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px 1px 3px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); border: 2px solid rgba(0, 0, 0, 0.5); }
html.ui-new .bp-info .nh-chip .uic { width: 22px; height: 22px; }
html.ui-new .bp-info .nh-chip b { font-family: var(--font-display, sans-serif); font-weight: 400; color: #fff8e6; }
html.ui-new .bp-info .nh-chip b.bad { color: #ff8a8a; }
html.ui-new .bp-info .nh-chip small { font-size: 11px; opacity: .8; }
html.ui-new .bp-info .nh-qbar { position: relative; width: 60px; height: 9px; border-radius: 99px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
html.ui-new .bp-info .nh-qbar > i { position: absolute; inset: 0 auto 0 0; background: #7ee05a; }
html.ui-new .bp-info > span:nth-child(n+2) { display: inline-flex !important; }
html.ui-new #bpActions .bp-effect, html.ui-new #bpActions .bp-branch-title { display: none !important; }
html.ui-new #bpActions .bp-btn > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
html.ui-new #bpActions .bp-btn > span:first-child .uic { width: 24px; height: 24px; }
html.ui-new #bpActions .bp-btn > span:first-child b { font-family: var(--font-display, sans-serif); font-weight: 400; font-size: 17px; }
html.ui-new #bpActions .bp-btn .cost { display: inline-flex; align-items: center; gap: 4px; }
html.ui-new #bpActions .bp-btn .cost img { width: 26px; height: 26px; object-fit: contain; }
html.ui-new #bpActions .bp-btn .cost .uic { width: 20px; height: 20px; }
html.ui-new #bpActions .bp-btn .cost b.bad { color: #ff8a8a; font-family: var(--font-display, sans-serif); font-weight: 400; font-size: 17px; }
html.ui-new .hud .toasts .toast.tv { align-self: center; }
/* kingdoms: colour · name · a power bar (no tiny numbers); the leader wears the crown */
html.ui-new #kingdomList .k-stats, html.ui-new #kingdomList .k-score { display: none !important; }
html.ui-new #kingdomList .k-pow { display: block; position: relative; flex: none; width: 64px; height: 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(0, 0, 0, 0.55); overflow: hidden; margin-inline-start: auto; }
html.ui-new #kingdomList .k-pow > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
html.ui-new #kingdomList .k-rank .uic { width: 20px; height: 20px; vertical-align: middle; }
html.ui-new.touch-play #kingdomList .k-pow { width: 44px; height: 8px; }
html.ui-new .bp-info .nh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* the death card: a skull and the countdown (no sentences) */
html.ui-new .death-card h2 { font-size: 0 !important; line-height: 0; margin: 0 0 6px; }
html.ui-new .death-card h2::before { content: '☠'; display: block; font-size: 64px; line-height: 1.1; }
html.ui-new .death-card .death-hint, html.ui-new .death-card .death-lost { display: none; }

/* v1.4.3 lobby chest card: 3 trophies toward the Victory Chest; the card turns into the Victory Chest when one waits */
.nl-wins { position: absolute; top: calc(-34 * var(--u)); left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.nl-wins .km-wins { margin: 0; gap: calc(4 * var(--u)); }
.nl-wins .km-win { width: calc(24 * var(--u)); height: calc(24 * var(--u)); border-width: 2px; }
.nl-wins .km-win svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }
.nl-wins .km-wto, .nl-wins .km-vchest { display: none; }
.nl-chest.vic { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 var(--ink), 0 0 0 3px #ffd24a, 0 0 44px rgba(255, 210, 74, 0.8); }
.nl-chest.vic .nl-ct { color: #ffd24a; }

/* v1.4.3 the end screen in pictures (new UI): an icon and a number per statistic, no sentences, a big ▶ Play again */
html.ui-new #endSub, html.ui-new .pod-title, html.ui-new .pod-sub, html.ui-new .er-wallet, html.ui-new .km-parts,
html.ui-new #endKingdom .km-row small, html.ui-new #endKingdom .km-t b, html.ui-new #endKingdom .km-gift > b { display: none; }
html.ui-new .end-card > h2 { font-size: 64px; letter-spacing: 1px; }
.es-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.es-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(0, 0, 0, 0.45); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06); animation: esTile .35s cubic-bezier(.2, 1.5, .4, 1) both; }
.es-tile:nth-child(2) { animation-delay: .05s; } .es-tile:nth-child(3) { animation-delay: .1s; } .es-tile:nth-child(4) { animation-delay: .15s; }
.es-tile:nth-child(5) { animation-delay: .2s; } .es-tile:nth-child(6) { animation-delay: .25s; } .es-tile:nth-child(7) { animation-delay: .3s; } .es-tile:nth-child(n+8) { animation-delay: .35s; }
@keyframes esTile { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.es-tile .uic { width: 38px; height: 38px; }
.es-tile b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.1; color: #fff; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
html.ui-new #endKingdom .km-t { flex: 1; } html.ui-new #endKingdom .km-m { align-items: center; }
/* the optional rewarded ad: a TV, +5, a gem */
.er-ad { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 2px; padding: 8px 22px; border: 3px solid #14210f; border-radius: 16px; cursor: pointer; font: 400 26px var(--font-display); color: #fff; text-shadow: 0 2px 0 #000;
  background: linear-gradient(180deg, #7ee05a, #3f9a2c); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #14210f; animation: erAd 1.6s ease-in-out infinite; }
.er-ad .uic { width: 34px; height: 34px; }
.er-ad:hover { filter: brightness(1.1); } .er-ad:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 2px 0 #14210f; }
.er-ad.busy { animation: none; opacity: .7; cursor: wait; }
.er-ad.got { animation: erGot .5s cubic-bezier(.2, 1.6, .4, 1); background: linear-gradient(180deg, #ffe36a, #f0a51e); cursor: default; }
.er-ad.no { animation: erNo .4s; filter: grayscale(.8); }
.er-ad .er-ad-why { font: 400 20px var(--font-display); letter-spacing: .01em; white-space: nowrap; } /* v1.5.2 why there was no ad */
@keyframes erAd { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes erGot { from { transform: scale(1.4); } to { transform: none; } }
@keyframes erNo { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
html.ui-new .end-rewards.h-adonly { background: none; padding: 0; display: grid; place-items: center; }
/* the buttons */
html.ui-new .end-actions-main { display: flex; justify-content: center; align-items: stretch; gap: 12px; }
html.ui-new #btnPlayAgain { width: auto; min-width: 320px; height: 76px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-size: 34px; padding: 0 30px; animation: erAd 1.8s ease-in-out infinite; }
html.ui-new #btnPlayAgain .uic { width: 40px; height: 40px; }
html.ui-new #btnNewGame { width: 76px; min-width: 0 !important; height: 76px; padding: 12px !important; display: inline-grid; place-items: center; }
html.ui-new #btnNewGame .uic { width: 44px; height: 44px; }
html.ui-new #btnNextStage { width: auto; height: 76px; font-size: 26px; padding: 0 22px; }
html.ui-new .end-card.ec-tight #btnPlayAgain { min-width: 220px; height: 56px; font-size: 26px; }
html.ui-new .end-card.ec-tight #btnPlayAgain .uic { width: 30px; height: 30px; }
html.ui-new .end-card.ec-tight #btnNewGame, html.ui-new .end-card.ec-tight #btnNextStage { width: 56px; height: 56px; padding: 8px !important; }
html.ui-new .end-card.ec-tight #btnNextStage { width: auto; padding: 0 16px !important; }
html.ui-new .end-card.ec-tight .es-tile .uic { width: 28px; height: 28px; }
html.ui-new .end-card.ec-tight .es-tile b { font-size: 19px; }
html.ui-new .end-card.ec-tight > h2 { font-size: 44px; }

/* v1.4.3 Settings in the new UI: a picture on every tab, no paragraphs of help, the interface picked by picture */
html.ui-new #settingsModal .st-desc, html.ui-new #settingsModal .st-top p, html.ui-new #settingsModal .st-preset-desc,
html.ui-new #settingsModal .st-tag { display: none !important; }
html.ui-new #settingsTabs [data-tab] { display: inline-flex; align-items: center; gap: 6px; }
html.ui-new #settingsTabs .st-tic { width: 26px !important; height: 26px !important; flex: none; }
.st-uirow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-uib { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 16px; border: 3px solid rgba(0, 0, 0, 0.5); background: rgba(255, 255, 255, 0.05); color: inherit; font: inherit; cursor: pointer; }
.st-uib b { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.st-uib.on { border-color: #ffc832; background: rgba(255, 200, 50, 0.12); box-shadow: 0 0 18px rgba(255, 200, 50, 0.35); }
.st-uib .lang-on { position: absolute; top: 6px; right: 10px; color: #7ee05a; font-weight: 900; }
.st-uipic { position: relative; width: 100%; max-width: 220px; aspect-ratio: 16 / 9; border-radius: 10px; border: 2px solid #1d1a17; background: linear-gradient(180deg, #5d8a3f, #3c6229); overflow: hidden; }
.st-uipic i { position: absolute; border: 2px solid #1d1a17; border-radius: 6px; }
/* the new UI: a big yellow Play, two cards, a dock */
.st-uipic.new i:nth-child(1) { left: 34%; right: 34%; top: 40%; height: 22%; background: linear-gradient(180deg, #ffe36a, #f0a51e); border-radius: 8px; }
.st-uipic.new i:nth-child(2) { left: 5%; width: 20%; top: 30%; height: 36%; background: #34405a; }
.st-uipic.new i:nth-child(3) { right: 5%; width: 20%; top: 30%; height: 36%; background: #6b5320; border-color: #ffc832; }
.st-uipic.new i:nth-child(4) { left: 25%; right: 25%; bottom: 5%; height: 15%; background: repeating-linear-gradient(90deg, #f0a51e 0 22%, transparent 22% 26%); border: 0; }
/* the classic UI: a menu list on the left, panels */
.st-uipic.classic { background: linear-gradient(180deg, #1c2a20, #101812); }
.st-uipic.classic i:nth-child(1) { left: 5%; width: 30%; top: 10%; bottom: 10%; background: repeating-linear-gradient(180deg, #2e4a35 0 18%, transparent 18% 22%); border: 0; }
.st-uipic.classic i:nth-child(2) { left: 40%; right: 5%; top: 10%; height: 38%; background: #24382b; }
.st-uipic.classic i:nth-child(3) { left: 40%; width: 26%; top: 54%; bottom: 10%; background: #24382b; }
.st-uipic.classic i:nth-child(4) { right: 5%; width: 26%; top: 54%; bottom: 10%; background: linear-gradient(180deg, #ffe36a, #f0a51e); }

/* v1.4.3b the warnings in pictures; under the guide the Town Center one waits (the guide leads there anyway) */
html.ui-new .notc-badge, html.ui-new .stealth-badge { display: inline-flex; align-items: center; gap: 6px; }
html.ui-new .notc-badge .uic, html.ui-new .stealth-badge .uic { width: 24px; height: 24px; }
html.ui-new.guide-on .notc-badge { display: none !important; }

/* =====================================================================
 * v1.5.3 PHONES (landscape) — the menus laid out like a mobile game
 * (v1.5.5: every build — site, CrazyGames, Playgama; was the Playgama build's pg.css; html.ui-compact = a phone
 * or any window up to 540 px tall, set by Device.js):
 * a full-screen panel, a thin top bar, a tab rail on the left and only
 * the content list scrolling (never the page). Tablets and normal-sized computer windows unchanged.
 * ===================================================================== */
html.ui-new.ui-compact:not(.no-compact) {
  --pg-l: max(env(safe-area-inset-left, 0px), var(--pg-sa-left, 0px)); --pg-r: max(env(safe-area-inset-right, 0px), var(--pg-sa-right, 0px));
  --pg-t: max(env(safe-area-inset-top, 0px), var(--pg-sa-top, 0px)); --pg-b: max(env(safe-area-inset-bottom, 0px), var(--pg-sa-bottom, 0px));
  --pgx: max(6px, var(--pg-l)); --pgxr: max(6px, var(--pg-r));
}
/* the match HUD keeps clear of a notch / camera hole / platform UI (the Bridge's safe area; 0 almost everywhere) */
html.ui-new.ui-compact:not(.no-compact).touch-play .hud { left: var(--pg-l); right: var(--pg-r); top: var(--pg-t); bottom: var(--pg-b); }
html.ui-new.ui-compact:not(.no-compact) #settingsModal, html.ui-new.ui-compact:not(.no-compact) #shopModal { padding: max(6px, var(--pg-t)) var(--pgxr) max(6px, var(--pg-b)) var(--pgx); }

/* ---------- Settings: rail + compact rows (label left, control right) ---------- */
html.ui-new.ui-compact:not(.no-compact) #settingsModal .settings-card {
  width: 100%; max-width: none; height: calc(var(--vh100) - 12px); max-height: none;
  display: grid; grid-template-columns: 146px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  gap: 6px 10px; padding: 7px 10px 8px; border-radius: 18px; overflow: hidden;
}
html.ui-new.ui-compact:not(.no-compact) #settingsModal .shop-head { grid-column: 1 / -1; margin: 0; gap: 8px; min-height: 0; }
html.ui-new.ui-compact:not(.no-compact) #settingsTitle { font-size: 24px; line-height: 1; }
html.ui-new.ui-compact:not(.no-compact) #settingsClose, html.ui-new.ui-compact:not(.no-compact) #shopClose { position: relative; width: 38px; height: 38px; border-radius: 11px; }
html.ui-new.ui-compact:not(.no-compact) #settingsClose::after, html.ui-new.ui-compact:not(.no-compact) #shopClose::after { content: ''; position: absolute; inset: -4px; }
html.ui-new.ui-compact:not(.no-compact) #settingsTabs { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 5px; margin: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
html.ui-new.ui-compact:not(.no-compact) #settingsTabs::-webkit-scrollbar { display: none; }
html.ui-new.ui-compact:not(.no-compact) #settingsTabs button { flex: none; width: 100%; min-height: 42px; justify-content: flex-start; gap: 7px; padding: 3px 10px; border-width: 2px; border-radius: 12px; font-size: 15px; text-align: start; }
html.ui-new.ui-compact:not(.no-compact) #settingsTabs .st-tic { width: 22px !important; height: 22px !important; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody { grid-column: 2; grid-row: 2; min-height: 0; gap: 6px; padding: 0 3px 2px 0; font-size: 13px; overscroll-behavior: contain; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group { flex: none; padding: 6px 10px; gap: 4px; border-radius: 12px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group h4 { margin: 0; font-size: 15px; line-height: 1.15; }
/* a setting with one choice row: the name on the left, the choices on the right */
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-seg, html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-rowbtns {
  display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 2px; min-height: 46px;
}
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-seg > h4, html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-rowbtns > h4 { grid-column: 1; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group > .st-seg, html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group > .st-row-btns { grid-column: 2; justify-self: end; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-seg > :not(h4):not(.st-seg):not(.st-row-btns) { grid-column: 1 / -1; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-seg { flex-wrap: wrap; justify-content: flex-end; padding: 2px; gap: 2px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-seg button { min-height: 34px; padding: 3px 10px; font-size: 13px; border-radius: 9px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-row-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-row-btns button, html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group > .btn-ghost { min-height: 36px; padding: 4px 12px; font-size: 13px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-toggles { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 0; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-toggle { min-height: 40px; padding: 2px 0; gap: 8px; font-size: 13px; line-height: 1.2; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-slider { grid-template-columns: minmax(84px, 30%) minmax(0, 1fr) 42px; gap: 10px; min-height: 36px; font-size: 13px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-slider input { height: 28px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .lang-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin-top: 2px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .lang-btn { min-height: 40px; padding: 4px 10px; gap: 8px; font-size: 13px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-uirow { gap: 8px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-uipic { max-width: 150px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-uib { padding: 6px; gap: 3px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-uib b { font-size: 16px; }

/* ---------- Shop: rail of tabs + a grid of small cards (3–5 across), only the grid scrolls ---------- */
html.ui-new.ui-compact:not(.no-compact) #shopModal .shop-card {
  width: 100%; max-width: none; height: calc(var(--vh100) - 12px); max-height: none;
  display: grid; grid-template-columns: 132px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  gap: 6px 8px; padding: 7px 10px 8px; border-radius: 18px; overflow: hidden;
}
html.ui-new.ui-compact:not(.no-compact) #shopModal.sh-solo .shop-card { grid-template-columns: minmax(0, 1fr); }
html.ui-new.ui-compact:not(.no-compact) #shopModal .shop-head { grid-column: 1 / -1; margin: 0; gap: 8px; min-height: 0; }
html.ui-new.ui-compact:not(.no-compact) #shopTitle { font-size: 24px; line-height: 1; }
html.ui-new.ui-compact:not(.no-compact) #shopModal .wallet .w-item { font-size: 15px; padding: 3px 10px 3px 7px; }
html.ui-new.ui-compact:not(.no-compact) #shopModal .wallet .cur-ico { width: 18px; height: 18px; }
html.ui-new.ui-compact:not(.no-compact) #shopTabs { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 5px; margin: 0; min-height: 0; padding: 6px 4px 6px 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
html.ui-new.ui-compact:not(.no-compact) #shopTabs::-webkit-scrollbar { display: none; }
html.ui-new.ui-compact:not(.no-compact) #shopTabs button { flex: none; width: 100%; min-height: 40px; padding: 3px 9px; justify-content: flex-start; text-align: start; font-size: 14px; line-height: 1.05; border-width: 2px; border-radius: 12px; }
html.ui-new.ui-compact:not(.no-compact) #shopTabs button.tab-hot::after { top: -5px; right: -3px; font-size: 8px; padding: 0 4px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid { grid-column: 2; grid-row: 2; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 7px; padding: 6px 3px 4px 2px; align-content: start; overscroll-behavior: contain; }
html.ui-new.ui-compact:not(.no-compact) #shopModal.sh-solo #shopGrid { grid-column: 1 / -1; }
/* long explanations are for the big screen; the cards say it in pictures */
html.ui-new.ui-compact:not(.no-compact) #shopGrid > .sh-note { display: none; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-section { margin: 2px 2px 0; font-size: 15px; line-height: 1.1; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-section small { display: none; }
/* the item card: picture, name, one price button */
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card { gap: 3px; padding: 6px 5px 6px; border-radius: 13px; min-width: 0; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card:hover { transform: none; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card canvas:not(.sh-kfx) { width: 64px; height: 64px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card .sh-tier { font-size: 8.5px; padding: 0 5px; margin-top: 0; line-height: 1.5; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card .sh-name { font-size: 13px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card > .sh-sub { font-size: 10.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card.h-buybtn > .sh-prices { display: none; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-buyrow { width: 100%; gap: 4px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-buyrow .sh-btn { min-height: 32px; padding: 3px 6px; font-size: 13px; border-radius: 10px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-buyrow .sh-btn svg { width: 14px; height: 14px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-owned { font-size: 12px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card > .lk-newtag { transform: scale(.8); transform-origin: top right; }
/* kill motions & banners: a wide picture, two or three across */
html.ui-new.ui-compact:not(.no-compact) #shopGrid.killfx, html.ui-new.ui-compact:not(.no-compact) #shopGrid.kbanner { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card canvas.sh-kfx { width: 100%; height: auto; aspect-ratio: 26 / 15; max-height: 84px; object-fit: cover; border-radius: 10px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-card .kb-plate { margin: 8px 0 6px; transform: scale(.72); transform-origin: center; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-frame-pv { transform: scale(.8); margin: -4px 0; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-perk-ico { width: 52px; height: 52px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-perk-ico svg { width: 30px; height: 30px; }
/* settings: a row with one button (Tutorial) sits like the others */
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-h4btn { display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 46px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-h4btn > .btn-ghost { justify-self: end; width: auto; }
/* packs: picture on the left, what is inside on the right, two packs across */
html.ui-new.ui-compact:not(.no-compact) #shopGrid.packs { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle { display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-rows: auto auto; align-items: start; column-gap: 8px; row-gap: 4px; padding: 6px; text-align: start; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-art { grid-row: 1 / 3; width: 116px; height: 112px; border-radius: 10px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-art .bd-tc { width: 150px; height: 102px; left: -14px; top: -4px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-art .bd-lord { width: 62px; height: 62px; right: 3px; bottom: 3px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-txt { gap: 1px; padding: 0; min-width: 0; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-txt .sh-name { font-size: 16px; white-space: normal; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-txt > .sh-sub, html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle-txt > .sh-prices { display: none; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-parts { margin: 1px 0 0; padding-inline-start: 13px; font-size: 10.5px; line-height: 1.25; gap: 0 8px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-parts li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle .sh-buyrow { grid-column: 2; align-self: end; justify-content: flex-start; flex-wrap: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-bundle .sh-chip { min-height: 32px; padding: 2px 8px; font-size: 12px; flex: none; }
/* the chest: a low banner, the odds always in sight */
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-chest { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 6px 10px; border-radius: 13px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-art { width: 112px; height: 94px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-art canvas { width: 112px !important; height: 94px !important; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-info h3 { font-size: 19px; margin: 0; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-info > p, html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-info > small { display: none; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-odds { margin: 4px 0; gap: 4px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-odds li { padding: 2px 7px; font-size: 11px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-odds li b { font-size: 13px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-pity { height: 18px; margin: 2px 0 6px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .chest-pity span { line-height: 18px; font-size: 10.5px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid #btnOpenChest { min-height: 36px; min-width: 0; padding: 4px 16px; font-size: 14px; }
/* achievements: one list */
html.ui-new.ui-compact:not(.no-compact) #shopGrid.achievements { grid-template-columns: minmax(0, 1fr); gap: 5px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-career { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 5px; margin-bottom: 2px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-career div { padding: 4px 4px 5px; border-radius: 10px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-career b { font-size: 17px; line-height: 1.1; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-career span { font-size: 10px; line-height: 1.15; text-align: center; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .ach-head { gap: 10px; padding: 6px 10px; border-radius: 12px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .ach-head-txt b { font-size: 19px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .ach-head-txt small { font-size: 11px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-titles { padding: 5px 8px; font-size: 12px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-ach { gap: 8px; padding: 5px 10px; border-radius: 10px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .ach-badge { width: 52px; height: 60px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .ach-badge span { font-size: 10px; }
html.ui-new.ui-compact:not(.no-compact) #shopGrid .sh-buyrow .sh-btn { white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-replay { display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 46px; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody .st-group.h-replay > :not(h4) { grid-column: 2; }
html.ui-new.ui-compact:not(.no-compact) #settingsBody #btnReplayTutorial { justify-self: end; width: auto; }

/* ---------- Locker: your lord on the left (its own scroll), the item list on the right ---------- */
html.ui-new.ui-compact:not(.no-compact) #lockerModal { padding: 6px var(--pgxr) 6px var(--pgx); }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .locker-card { width: 100%; max-width: none; height: calc(var(--vh100) - 12px); max-height: none; padding: 7px 10px 8px; border-radius: 18px; gap: 6px; overflow: hidden; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .shop-head { margin: 0; gap: 8px; min-height: 0; }
html.ui-new.ui-compact:not(.no-compact) #lockerTitle { font-size: 24px; line-height: 1; }
html.ui-new.ui-compact:not(.no-compact) #lockerClose { position: relative; width: 38px; height: 38px; border-radius: 11px; }
html.ui-new.ui-compact:not(.no-compact) #lockerClose::after { content: ''; position: absolute; inset: -4px; }
html.ui-new.ui-compact:not(.no-compact) #lkShop { min-height: 36px; padding: 4px 12px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-body { display: grid; grid-template-columns: 172px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; overflow: hidden; align-content: stretch; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-side { order: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 6px; padding-right: 2px; scrollbar-width: thin; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-stage { flex: none; padding: 2px 4px 6px; border-radius: 12px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-stage canvas { width: 112px; height: 112px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-plate .name-tag { font-size: 13px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-worn { flex: none; gap: 2px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-wrow { min-height: 30px; padding: 3px 7px; align-items: center; border-radius: 8px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-wrow span { font-size: 10.5px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-wrow b { font-size: 11.5px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-h { flex: none; margin: 2px 0 0; font-size: 15px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-loadouts { flex: none; gap: 4px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-load { padding: 4px 7px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; row-gap: 3px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-load span { grid-column: 1; grid-row: 3; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-load .sh-chip { min-height: 30px; padding: 2px 8px; font-size: 11.5px; }
html.ui-new.ui-compact:not(.no-compact) #lockerModal .lk-main { min-height: 0; display: flex; flex-direction: column; gap: 6px; }
html.ui-new.ui-compact:not(.no-compact) #lkTabs { flex: none; flex-wrap: nowrap; gap: 5px; margin: 0; padding: 6px 2px 4px; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; }
html.ui-new.ui-compact:not(.no-compact) #lkTabs::-webkit-scrollbar { display: none; }
html.ui-new.ui-compact:not(.no-compact) #lkTabs button { flex: none; min-height: 36px; padding: 2px 10px; font-size: 13px; white-space: nowrap; border-width: 2px; border-radius: 11px; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px; padding: 2px 3px 4px 2px; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-card { gap: 3px; padding: 6px 5px; border-radius: 13px; min-width: 0; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-card:hover { transform: none; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-card canvas:not(.sh-kfx) { width: 64px; height: 64px; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-card .sh-name { font-size: 12.5px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-card > .sh-sub { font-size: 10px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-card .sh-tier { font-size: 8.5px; padding: 0 5px; line-height: 1.5; margin-top: 0; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-btn { min-height: 32px; padding: 3px 8px; font-size: 12.5px; border-radius: 10px; white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid.lk-killfx, html.ui-new.ui-compact:not(.no-compact) #lkGrid.lk-kbanner { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
html.ui-new.ui-compact:not(.no-compact) #lkGrid canvas.sh-kfx { width: 100%; max-width: none; height: auto; aspect-ratio: 26 / 15; max-height: 84px; border-radius: 10px; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .kb-plate { margin: 8px 0 6px; transform: scale(.72); }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .sh-frame-pv { transform: scale(.8); margin: -4px 0; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid > .sh-note, html.ui-new.ui-compact:not(.no-compact) #lkGrid > .lk-empty { grid-column: 1 / -1; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .lk-more { min-height: 0; gap: 4px; padding: 6px; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .lk-more-ico { width: 40px; height: 40px; font-size: 24px; }
html.ui-new.ui-compact:not(.no-compact) #lkGrid .lk-more b { font-size: 11.5px; }

/* ---------- Profile: who you are on the left, what you change on the right ---------- */
html.ui-new.ui-compact:not(.no-compact) #accountModal { padding: 6px var(--pgxr) 6px var(--pgx); }
html.ui-new.ui-compact:not(.no-compact) #accountModal .account-card { width: min(780px, 100%); max-width: none; max-height: calc(var(--vh100) - 12px); padding: 8px 12px 10px; border-radius: 18px; overscroll-behavior: contain; }
html.ui-new.ui-compact:not(.no-compact) #accountTitle { margin: 0 0 6px; font-size: 24px; line-height: 1.1; }
html.ui-new.ui-compact:not(.no-compact) #accountClose { top: 7px; right: 8px; width: 38px; height: 38px; }
html.ui-new.ui-compact:not(.no-compact) #accountClose::after { content: ''; position: absolute; inset: -4px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 14px; row-gap: 5px; align-items: start; }
html.ui-new.ui-compact:not(.no-compact) #accountBody > * { grid-column: 2; margin: 0; }
/* v1.5.5 our site's Account / Purchases tabs (no player card on the left): one column */
html.ui-new.ui-compact:not(.no-compact) #accountBody:not(.h-pfhead) { grid-template-columns: minmax(0, 1fr); }
html.ui-new.ui-compact:not(.no-compact) #accountBody:not(.h-pfhead) > * { grid-column: 1; }
html.ui-new.ui-compact:not(.no-compact) #accountBody > .pf-head { grid-column: 1; grid-row: 1 / span 4; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody > .pf-head > .pf-av { width: 64px; height: 64px; font-size: 30px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-id { align-items: center; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-name b { font-size: 20px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody > .pf-stats { grid-column: 1; grid-row: 5 / span 5; grid-template-columns: 1fr 1fr; gap: 5px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-stats div { padding: 4px 3px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-stats b { font-size: 17px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-stats span { font-size: 10px; line-height: 1.15; }
html.ui-new.ui-compact:not(.no-compact) #accountBody > h4 { font-size: 14px; line-height: 1.1; margin-top: 3px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-row { gap: 6px; flex-wrap: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-row input { min-height: 38px; padding: 6px 10px; font-size: 15px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-row .sh-btn, html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-row .btn-ghost { flex: none; min-height: 36px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-avatars { gap: 4px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-avpick { padding: 1px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-avpick .pf-av { width: 40px; height: 40px; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-locker span { font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-new.ui-compact:not(.no-compact) #accountBody .pf-links { margin-top: 2px; flex-wrap: wrap; }

/* ---------- Pause: the same three buttons, sized for a phone ---------- */
html.ui-new.ui-compact:not(.no-compact) .pause-card { width: min(360px, 92vw); max-height: calc(var(--vh100) - 16px); padding: 10px 20px 12px; gap: 8px; border-radius: 20px; }
html.ui-new.ui-compact:not(.no-compact) .pause-card h2 { font-size: 30px; line-height: 1.05; }
html.ui-new.ui-compact:not(.no-compact) .pause-sub { font-size: 12.5px; }
html.ui-new.ui-compact:not(.no-compact) .pause-card .btn-primary, html.ui-new.ui-compact:not(.no-compact) .pause-card .btn-ghost { min-height: 48px; font-size: 22px; border-radius: 15px; }
html.ui-new.ui-compact:not(.no-compact) #btnResume { min-height: 58px; font-size: 28px; }
html.ui-new.ui-compact:not(.no-compact) .pause-note { font-size: 11.5px; }

/* ---------- In a match on a phone: the coach's pill (first matches) stays small, the battlefield stays in view ---------- */
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal { grid-template-columns: 30px auto auto auto auto; gap: 6px; padding: 2px 8px 5px 2px; border-width: 2px; border-radius: 13px; max-width: min(440px, calc(100vw - 300px)); box-shadow: 0 3px 0 var(--ink), 0 0 0 2px #ffc832, 0 6px 14px rgba(0, 0, 0, 0.3); }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-ico { width: 30px; height: 30px; border-width: 2px; border-radius: 9px; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-ico svg { width: 21px; height: 21px; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-main { gap: 7px; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-main b { font-size: 15px; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-main small { gap: 4px; font-size: 11px; zoom: 0.8; --zf: 0.8; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-prog { font-size: 16px; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tg-skip { width: 24px; height: 24px; font-size: 11px; }
html.ui-new.ui-compact:not(.no-compact).touch-play .tut-goal .tut-bar { height: 4px; }

/* ---------- Market (in a match): four low rows, all in sight ---------- */
html.ui-new.ui-compact:not(.no-compact) #marketModal { padding: 6px var(--pgxr) 6px var(--pgx); }
html.ui-new.ui-compact:not(.no-compact) .market-card { width: min(600px, 100%); max-height: calc(var(--vh100) - 12px); overflow-y: auto; overscroll-behavior: contain; padding: 7px 12px 9px; border-radius: 18px; }
html.ui-new.ui-compact:not(.no-compact) .market-head { margin-bottom: 4px; gap: 8px; align-items: center; }
html.ui-new.ui-compact:not(.no-compact) .market-head h2 { font-size: 24px; line-height: 1; }
html.ui-new.ui-compact:not(.no-compact) .market-gold { padding: 3px 10px; font-size: 19px; }
html.ui-new.ui-compact:not(.no-compact) .market-gold .res-icon { width: 24px; height: 24px; }
html.ui-new.ui-compact:not(.no-compact) #mkClose { position: relative; width: 38px; height: 38px; border-radius: 11px; }
html.ui-new.ui-compact:not(.no-compact) #mkClose::after { content: ''; position: absolute; inset: -4px; }
html.ui-new.ui-compact:not(.no-compact) .market-owners { margin: 0 0 5px; font-size: 11px; line-height: 1.3; }
html.ui-new.ui-compact:not(.no-compact) .market-rows { gap: 5px; }
html.ui-new.ui-compact:not(.no-compact) .mk-row { padding: 4px 8px; gap: 8px; border-width: 2px; border-radius: 13px; box-shadow: 0 3px 0 var(--ink); }
html.ui-new.ui-compact:not(.no-compact) .mk-row .res-icon { width: 30px; height: 30px; }
html.ui-new.ui-compact:not(.no-compact) .mk-name { font-size: 17px; line-height: 1.05; }
html.ui-new.ui-compact:not(.no-compact) .mk-stock { font-size: 11px; }
html.ui-new.ui-compact:not(.no-compact) .mk-btn { min-height: 42px; min-width: 96px; padding: 2px 8px; font-size: 16px; border-width: 2px; border-radius: 12px; }
html.ui-new.ui-compact:not(.no-compact) .mk-btn small { font-size: 11px; }

/* ---------- Story: the title bar, the ✕ and the star road stay put; only the chapters scroll ---------- */
html.ui-new.ui-compact:not(.no-compact) #cqOverlay { padding: 6px var(--pgxr) 6px var(--pgx); }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-card { display: flex; flex-direction: column; width: 100%; max-width: none; max-height: calc(var(--vh100) - 12px); overflow: hidden; padding: 7px 12px 8px; border-radius: 18px; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-card > * { flex: none; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-top h2 { font-size: 24px; line-height: 1.05; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-x { position: relative; width: 38px; height: 38px; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-x::after { content: ''; position: absolute; inset: -4px; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-sub { display: none; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-road { margin: 4px 22px 26px; }
html.ui-new.ui-compact:not(.no-compact) #cqOverlay .cq-chapters { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 8px; padding: 2px 3px 2px 0; }
html.ui-new.ui-compact:not(.no-compact) #accountModal .account-card { display: flex; flex-direction: column; overflow: hidden; }
html.ui-new.ui-compact:not(.no-compact) #accountModal .account-card > * { flex: none; }
html.ui-new.ui-compact:not(.no-compact) #accountBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; }

/* ---------- About: one screen, the credits side by side ---------- */
html.ui-new.ui-compact:not(.no-compact) #aboutModal { padding: 6px var(--pgxr) 6px var(--pgx); }
html.ui-new.ui-compact:not(.no-compact) .about-card { width: min(640px, 100%); max-height: calc(var(--vh100) - 12px); overflow-y: auto; padding: 10px 16px 12px; gap: 4px; border-radius: 18px; }
html.ui-new.ui-compact:not(.no-compact) .about-card .logo { font-size: 34px; }
html.ui-new.ui-compact:not(.no-compact) .about-ver { font-size: 15px; }
html.ui-new.ui-compact:not(.no-compact) .about-sub { margin: 0 0 4px; font-size: 11px; }
html.ui-new.ui-compact:not(.no-compact) .credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 4px 0 0; }
html.ui-new.ui-compact:not(.no-compact) .credit { padding: 6px 8px; border-radius: 12px; min-width: 0; }
html.ui-new.ui-compact:not(.no-compact) .credit span { font-size: 10.5px; }
html.ui-new.ui-compact:not(.no-compact) .credit b { font-size: 16px; overflow-wrap: anywhere; }
html.ui-new.ui-compact:not(.no-compact) #aboutClose { width: 38px; height: 38px; top: 8px; right: 8px; }

/* v1.5.4 loading screen: a tip under the bar (v1.5.5 every build) */
.bl-tip { max-width: min(420px, 90vw); min-height: 2.7em; font-size: 14px; font-weight: 700; line-height: 1.35; color: #f1e6c4; text-align: center; opacity: 0; }
.bl-tip.in { animation: blTip .45s ease forwards; }
@keyframes blTip { from { opacity: 0; transform: translateY(5px); } to { opacity: .95; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bl-tip.in { animation: none; opacity: .95; } }

/* v1.5.5 portals (CrazyGames…): no online ranks, no purchase history — nothing is sold and there are no accounts there */
html.portal .w-rank, html.portal #lkHistory, html.portal .about-tech { display: none !important; }
html.portal .sh-note.sh-earn { grid-column: 1 / -1; }

/* v1.5.5 io Deathmatch: the new life's protection in the mode panel */
.mp-shield { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 4px 9px; border-radius: 10px; background: rgba(255, 216, 106, 0.16); border: 1px solid rgba(255, 216, 106, 0.5); color: #ffe9a3; font-weight: 900; font-size: 13px; }
.mp-shield .uic, .mp-shield svg { width: 18px; height: 18px; }
.mp-shield b { margin-inline-start: auto; font-family: var(--font-display); font-size: 16px; font-variant-numeric: tabular-nums; }
/* v1.5.5 io Deathmatch: the kit of a new life (three cards at the bottom middle, the battlefield stays in view) */
.dm-kit { position: fixed; left: 0; right: 0; width: max-content; max-width: calc(100vw - 24px); margin: 0 auto; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 14px 12px; border-radius: 20px; border: 3px solid var(--ink, #1d1a17); box-shadow: 0 5px 0 var(--ink, #1d1a17); pointer-events: auto; animation: blTip .35s ease both; }
.dm-kit .dk-title { font-family: var(--font-display); font-size: 22px; color: #ffe9a3; text-shadow: 0 2px 0 #1d1a17; }
.dm-kit .dk-row { display: flex; gap: 10px; }
.dm-kit .dk-card { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 128px; padding: 8px 6px 9px; border: 3px solid var(--ink, #1d1a17); border-radius: 16px; background: linear-gradient(180deg, #4a5670, #2d3446); color: #fff; cursor: pointer; box-shadow: inset 0 3px 0 rgba(255,255,255,.22), 0 4px 0 var(--ink, #1d1a17); font: inherit; }
.dm-kit .dk-card:hover { filter: brightness(1.12); transform: translateY(-2px); }
.dm-kit .dk-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink, #1d1a17); }
.dm-kit .dk-ico svg, .dm-kit .dk-ico .uic { width: 38px; height: 38px; }
.dm-kit .dk-card b { font-family: var(--font-display); font-size: 17px; }
.dm-kit .dk-card small { font-size: 12px; font-weight: 800; color: #cfe6b8; }
.dm-kit .dk-bar { width: 100%; height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.dm-kit .dk-bar i { display: block; height: 100%; width: 100%; background: #ffd86a; }
html.ui-new.ui-compact:not(.no-compact) .dm-kit { bottom: 96px; padding: 6px 10px 8px; gap: 5px; }
html.ui-new.ui-compact:not(.no-compact) .dm-kit .dk-card { width: 104px; padding: 5px 4px 6px; }
html.ui-new.ui-compact:not(.no-compact) .dm-kit .dk-title { font-size: 17px; }

/* v1.5.7 "Play again" says what comes next: the new landscape and the extra rival (a small line under the label) */
#btnPlayAgain { position: relative; }
html.ui-new #btnPlayAgain.h-panext { flex-wrap: wrap; row-gap: 0; align-content: center; height: 84px; }
.pa-next { flex-basis: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 400 15px/1 var(--font-display, inherit); color: #fff3c4; text-shadow: 0 1px 0 #1d1a17; opacity: .95; }
.pa-next .uic { width: 18px !important; height: 18px !important; }
.pa-next i { font-style: normal; display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 4px; border-radius: 99px; background: rgba(0, 0, 0, 0.28); }
.pa-next i b { color: #ffd24a; }
html.ui-new .end-card.ec-tight #btnPlayAgain.h-panext { height: 64px; }
html.ui-new .end-card.ec-tight .pa-next { font-size: 13px; }
/* v1.5.7 Playgama: the online battle next to Play again */
html.ui-new .end-actions-main #btnEndOnline { width: auto; height: 76px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; font-size: 24px; background: linear-gradient(180deg, #3fd2c7, #168f86); }
html.ui-new #btnEndOnline .uic { width: 34px; height: 34px; }
html.ui-new .end-card.ec-tight #btnEndOnline { height: 56px; font-size: 20px; }
html.ui-new .end-card.ec-tight #btnEndOnline .uic { width: 26px; height: 26px; }
@media (max-width: 560px) { html.ui-new #btnEndOnline span { display: none; } }

/* v1.5.7 the 10-minute chest: a ring on the chest card that fills while the player plays today */
.nl-pt { position: absolute; right: calc(-20 * var(--u)); top: calc(-24 * var(--u)); width: calc(66 * var(--u)); height: calc(66 * var(--u)); padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.nl-pt-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#ffc832 var(--pt, 0%), #11141b 0); box-shadow: 0 0 0 3px var(--ink), 0 3px 0 3px var(--ink); }
.nl-pt-ring::after { content: ''; position: absolute; inset: calc(7 * var(--u)); border-radius: 50%; background: linear-gradient(180deg, var(--slate1, #3a4458), var(--slate2, #262c3a)); }
.nl-pt-ic { position: relative; width: calc(34 * var(--u)); height: calc(34 * var(--u)); margin-top: calc(-8 * var(--u)); }
.nl-pt-ic .uic, .nl-pt-ic svg { width: 100%; height: 100%; }
.nl-pt-n { position: absolute; bottom: calc(-6 * var(--u)); left: 50%; transform: translateX(-50%); padding: 0 calc(6 * var(--u)); border-radius: 99px; border: 2px solid var(--ink); background: #1d2230; font: 400 calc(14 * var(--u)) / 1.3 var(--font-display); color: #fff; white-space: nowrap; }
.nl-pt.ready .nl-pt-ring { box-shadow: 0 0 0 3px var(--ink), 0 3px 0 3px var(--ink), 0 0 22px rgba(255, 200, 50, 0.85); }
.nl-pt.ready { animation: nlPtGo 1.4s ease-in-out infinite; }
.nl-pt.ready .nl-pt-n { background: linear-gradient(180deg, var(--green1, #7ee05a), var(--green2, #2f8f2a)); }
.nl-pt.nudge { animation: erNo .4s; }
@keyframes nlPtGo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .nl-pt.ready { animation: none; } }
html:not(.ui-new) .pa-next { display: flex; margin-top: 2px; font-size: 13px; }
/* v1.5.9 online: the opt-in rewarded ad on the death screen (a TV, +100 wood, +50 stone) · the clock waits for an ad */
.death-ad { display: flex; margin: 14px auto 0; font-size: 22px; padding: 6px 16px; gap: 6px; }
.death-ad .uic { width: 28px; height: 28px; }
#deathScreen.death-wait .death-timer span { visibility: hidden; }
#deathScreen.death-wait .death-timer { border-color: rgba(255, 255, 255, .7); border-top-color: transparent; animation: deathSpin 1s linear infinite; }
@keyframes deathSpin { to { transform: rotate(360deg); } }
/* v1.5.9 io Deathmatch: the one-life boosts as one compact strip of icons (price under each; the title is gone) */
html.ui-new .hud.mode-dm .boost-bar .bb-title { display: none; }
html.ui-new .hud.mode-dm .boost-bar { padding: 4px 6px; }
html.ui-new .hud.mode-dm .boost-bar .bb-row { flex-wrap: nowrap; gap: 3px; justify-content: space-between; }
html.ui-new .hud.mode-dm .boost-bar .bb-perk { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 1px; padding: 3px 1px; }
html.ui-new .hud.mode-dm .boost-bar .bb-perk .bb-ico svg { width: 20px; height: 20px; }
html.ui-new .hud.mode-dm .boost-bar .bb-buy button { font-size: 11px; padding: 1px 3px; display: inline-flex; align-items: center; gap: 1px; }
html.ui-new .hud.mode-dm .boost-bar .bb-buy button svg { width: 11px; height: 11px; }
html.ui-new .hud.mode-dm .boost-bar .bb-active { font-size: 9px; }
html.ui-new .mp-tog { font: 400 18px var(--font-display); color: var(--cream); text-shadow: var(--nl-out-s); }
html.ui-new.touch-play .mp-tog { font-size: 14px; }
/* v1.5.9 the clan panel (new UI): a compact card at the bottom left — not the wide Build dock, which put the hotbar over
   it; and its Found button is a real button (the dock's invisible full-tile .btn-craft overlay covered the whole panel,
   so any click in it — "Ask to join", ✓, Kick — pressed Found instead) */
html.ui-new #clanPanel.side-panel { right: auto; width: min(392px, calc(100vw / var(--nz, 1) - 34px)); margin: 0; display: flex; flex-direction: column; overflow: hidden; }
html.ui-new #clanPanel.side-panel.hidden { display: none; }
html.ui-new #clanPanel .panel-title { margin: 0 0 2px; padding-inline-end: 34px; }
html.ui-new #clanPanel .clan-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 3px; }
html.ui-new #clanPanel .clan-hint { font-size: 12px; margin-bottom: 6px; }
html.ui-new #clanPanel .clan-form input { border: 2px solid var(--ink); border-radius: 12px; background: rgba(0, 0, 0, .35); }
html.ui-new .side-panel #clanCreateBtn { position: static; inset: auto; opacity: 1; width: auto; height: auto; flex: none; padding: 5px 12px; border: 3px solid var(--ink); border-radius: 12px;
  background: linear-gradient(180deg, var(--purple1), var(--purple2)); color: #fff; font: 400 16px var(--font-display); text-shadow: 0 1px 0 #000; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 3px 0 var(--ink); cursor: pointer; }
html.ui-new .side-panel #clanCreateBtn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 1px 0 var(--ink); }
html.ui-new #clanPanel .cb { border: 2px solid var(--ink); }
html.ui-new.touch-play #clanPanel.side-panel { width: min(330px, calc(100vw / var(--pz, 1) - 24px)); }
html.ui-new.touch-play #clanPanel .clan-hint { display: none; }
html.ui-new.touch-play .side-panel #clanCreateBtn { font-size: 13px; padding: 3px 8px; }

/* =====================================================================
 * v1.6.0 one unlock per Kingdom Level: the end screen flips the new card,
 * the lobby tour shows where it lives
 * ===================================================================== */
/* the locked Custom button (Kingdom Level 8) and its NEW tag */
.nl-custom.locked { filter: saturate(0.25) brightness(0.8); }
.nl-custom.locked .uic { opacity: 0.85; }
.nl-custom { position: relative; }
.nl-custom.is-new::after { content: ''; position: absolute; right: calc(-6 * var(--u)); top: calc(-6 * var(--u)); width: calc(16 * var(--u)); height: calc(16 * var(--u)); border-radius: 50%; border: 3px solid var(--ink); background: var(--red1); }

/* end screen: a new mode / menu is a big card; its back (a lock) turns to its face */
.km-unl-big { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; perspective: 700px; }
.km-flip { width: 112px; height: 132px; animation: kmFlipIn .45s cubic-bezier(.2, 1.4, .4, 1) var(--d, 1s) backwards; }
.km-fl-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); animation: kmFlip .7s cubic-bezier(.3, 1.3, .5, 1) calc(var(--d, 1s) + .45s) forwards; }
.km-fl-back, .km-fl-face { position: absolute; inset: 0; display: grid; place-items: center; border: 3px solid #1d1a17; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 4px 0 #1d1a17; }
.km-fl-back { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #2f3648 0 10px, #262c3c 10px 20px); }
.km-fl-back .uic { width: 46px; height: 46px; }
.km-fl-face { grid-template-rows: 1fr auto; padding: 8px 6px 9px; background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, var(--a), var(--b)); box-shadow: 0 4px 0 #1d1a17, 0 0 26px rgba(255, 216, 74, 0.55); }
.km-fl-ic { display: grid; place-items: center; width: 62px; height: 62px; }
.km-fl-ic .uic { width: 58px; height: 58px; filter: drop-shadow(0 3px 0 rgba(29, 26, 23, 0.6)); }
.km-fl-face b { font-family: var(--font-display, sans-serif); font-weight: 400; font-size: 15px; line-height: 1.05; text-align: center; color: #fff8e6; text-shadow: 0 1.5px 0 #1d1a17, 1.5px 0 0 #1d1a17, -1.5px 0 0 #1d1a17, 0 -1.5px 0 #1d1a17, 0 3px 0 #1d1a17; }
.km-fl-new { position: absolute; top: -10px; right: -10px; padding: 1px 7px; border: 3px solid #1d1a17; border-radius: 9px; background: linear-gradient(180deg, #ff7564, #d43a2e); font: 400 12px var(--font-display, sans-serif); font-style: normal; color: #fff; box-shadow: 0 3px 0 #1d1a17; transform: rotate(8deg); }
.km-unl.has-big .km-unl-l { margin-top: 2px; }
.km-unl.has-big .km-unl-l .km-ut { animation-delay: 1.9s; }
@keyframes kmFlipIn { from { opacity: 0; transform: translateY(18px) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes kmFlip { 0% { transform: rotateY(180deg); } 100% { transform: rotateY(0deg); } }
.end-card.ec-tight .km-flip { width: 88px; height: 104px; }
.end-card.ec-tight .km-fl-ic, .end-card.ec-tight .km-fl-ic .uic { width: 42px; height: 42px; }
.end-card.ec-tight .km-fl-face b { font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .km-flip, .km-fl-in { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* the lobby tour: a dimmed screen with a lit hole, a ring, a tapping hand and a picture card */
.nl-tour { position: fixed; inset: 0; z-index: 9000; cursor: pointer; pointer-events: auto; font-family: var(--font-body, sans-serif); animation: ntIn .25s ease-out; }
.nl-tour.out { opacity: 0; transition: opacity .25s; }
.nt-hole { position: absolute; border-radius: calc(22 * var(--u, 1px)); box-shadow: 0 0 0 200vmax rgba(6, 8, 14, 0.72); transition: left .35s cubic-bezier(.3, 1.2, .4, 1), top .35s cubic-bezier(.3, 1.2, .4, 1), width .35s, height .35s; pointer-events: none; }
.nt-hole::after { content: ''; position: absolute; inset: -5px; border: 4px solid #ffd84a; border-radius: inherit; box-shadow: 0 0 22px rgba(255, 216, 74, 0.85), inset 0 0 14px rgba(255, 216, 74, 0.5); animation: ntRing 1.1s ease-in-out infinite; }
.nl-tour.no-target .nt-hole { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; }
.nl-tour.no-target .nt-hole::after, .nl-tour.no-target .nt-hand { display: none; }
.nt-hand { position: absolute; width: calc(78 * var(--u, 1px)); height: calc(78 * var(--u, 1px)); min-width: 48px; min-height: 48px; pointer-events: none; transform-origin: 30% 10%; animation: nlTap 1.1s ease-in-out infinite; transition: left .35s cubic-bezier(.3, 1.2, .4, 1), top .35s cubic-bezier(.3, 1.2, .4, 1); filter: drop-shadow(0 4px 0 rgba(29, 26, 23, 0.55)); }
.nt-card { position: absolute; display: grid; justify-items: center; gap: calc(6 * var(--u, 1px)); min-width: 150px; max-width: min(78vw, 300px); padding: calc(16 * var(--u, 1px)) calc(22 * var(--u, 1px)) calc(12 * var(--u, 1px)); border: 3px solid var(--ink, #1d1a17); border-radius: calc(22 * var(--u, 1px));
  background: radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 50%), linear-gradient(180deg, var(--a, #46506a), var(--b, #2b3245));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), 0 6px 0 var(--ink, #1d1a17), 0 18px 40px rgba(0, 0, 0, 0.5); pointer-events: none; }
.nl-tour.go .nt-card { animation: ntCard .45s cubic-bezier(.2, 1.5, .4, 1); }
.nt-ic { display: grid; place-items: center; width: clamp(56px, calc(84 * var(--u, 1px)), 90px); height: clamp(56px, calc(84 * var(--u, 1px)), 90px); border-radius: 50%; background: rgba(29, 26, 23, 0.28); border: 3px solid rgba(29, 26, 23, 0.6); }
.nt-ic .uic { width: 76%; height: 76%; filter: drop-shadow(0 3px 0 rgba(29, 26, 23, 0.55)); }
.nt-name { font: 400 clamp(20px, calc(30 * var(--u, 1px)), 32px) / 1.05 var(--font-display, sans-serif); color: var(--cream, #fff8e6); text-align: center; text-shadow: var(--nl-out, 0 3px 0 #1d1a17); }
.nt-sub { font: 400 clamp(13px, calc(17 * var(--u, 1px)), 18px) var(--font-display, sans-serif); color: #fff3c4; text-shadow: var(--nl-out-s, 0 2px 0 #1d1a17); }
.nt-new { position: absolute; top: -14px; right: -12px; padding: 2px 10px; border: 3px solid var(--ink, #1d1a17); border-radius: 10px; background: linear-gradient(180deg, var(--red1, #ff7564), var(--red2, #d43a2e)); font: 400 15px var(--font-display, sans-serif); font-style: normal; color: #fff; box-shadow: 0 3px 0 var(--ink, #1d1a17); transform: rotate(8deg); animation: nlBob 1.2s ease-in-out infinite; }
.nt-card.opt { min-width: 120px; padding-top: calc(12 * var(--u, 1px)); }
.nt-card.opt .nt-ic { width: clamp(44px, calc(60 * var(--u, 1px)), 64px); height: clamp(44px, calc(60 * var(--u, 1px)), 64px); }
.nt-card.opt .nt-name { font-size: clamp(17px, calc(24 * var(--u, 1px)), 26px); }
.nt-dots { display: flex; gap: 5px; }
.nt-dots:empty { display: none; }
.nt-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(29, 26, 23, 0.45); border: 1.5px solid rgba(29, 26, 23, 0.6); }
.nt-dots i.past { background: rgba(255, 248, 230, 0.55); }
.nt-dots i.on { background: #fff8e6; transform: scale(1.3); }
.nt-tap { font: 700 11.5px var(--font-body, sans-serif); color: rgba(255, 248, 230, 0.85); letter-spacing: 0.03em; animation: ntBlink 1.6s ease-in-out infinite; }
@keyframes ntIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ntRing { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.04); } }
@keyframes ntCard { from { opacity: 0; transform: scale(0.6) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ntBlink { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.4; } }
/* the Custom panel: a mode the kingdom has not opened yet (a lock and its level) */
.mode-card.locked { position: relative; opacity: 0.55; filter: grayscale(0.85); cursor: not-allowed; }
.mode-card.locked:hover { transform: none; }
.mode-card.locked::after { content: attr(data-lv); position: absolute; top: 6px; right: 8px; padding: 1px 7px; border-radius: 8px; background: rgba(20, 22, 30, 0.85); color: #ffe7a6; font: 700 11px var(--font-body, sans-serif); }
html.nt-on .nl-hand, html.nt-on #tutHand { visibility: hidden !important; }
/* the flip waits for a reward screen to close (UINew flipWake) */
.km-unl.wait .km-flip, .km-unl.wait .km-fl-in { animation-play-state: paused; }

/* v1.6.1 CrazyGames account integration: the player's CrazyGames picture on the avatar's corner, and a small
   "Sign in" for guests in the top bar (never the main call to action; hidden while a new kingdom sees only PLAY) */
.nl-cgpic { position: absolute; left: calc(2 * var(--u)); top: calc(2 * var(--u)); width: calc(32 * var(--u)); height: calc(32 * var(--u)); border-radius: 50%; border: 3px solid var(--ink); object-fit: cover; background: #2f4a25; box-shadow: 0 0 0 calc(2 * var(--u)) #fff; pointer-events: none; }
.nl-cglogin { cursor: pointer; gap: calc(6 * var(--u)); }
.nl-cglogin > .uic { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
.nl-cglogin b { font-size: calc(17 * var(--u)); }
#nlobby.fresh .nl-cglogin { display: none; }
@media (max-width: 760px), (max-height: 480px) {
  .nl-cgpic { width: calc(26 * var(--u)); height: calc(26 * var(--u)); }
  html.dev-phone .nl-cglogin b { display: none; }
}

/* v1.7.0 a locked button shakes when tapped (with its "opens at Kingdom Level n" note) */
@keyframes nlShake { 0%, 100% { translate: 0 0; } 20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 3px 0; } }
html.ui-new .nl-shake { animation: nlShake 0.42s ease-in-out; }
@media (prefers-reduced-motion: reduce) { html.ui-new .nl-shake { animation: none; } }

/* v1.7.0 the streak above the lobby chest card, and the 6-hour chest: what is inside and when it opens */
.nl-wins .km-gs { margin: 0; gap: calc(4 * var(--u)); }
.nl-wins .km-gsp { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }
.nl-wins .km-gsp .uic { width: calc(15 * var(--u)); height: calc(15 * var(--u)); }
.nl-wins .km-gsg { font-size: calc(14 * var(--u)); }
.nl-wins .km-gs.done { font-size: calc(12 * var(--u)); }
/* v1.7.0b the next reward, said loud: label + a big coloured chip + the 6-chest cycle */
.nl-chest .nl-cnext { display: flex; flex-direction: column; align-items: center; gap: calc(3 * var(--u)); }
.nl-chest .nl-cnl { font: 900 calc(10.5 * var(--u))/1 var(--font-body, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #ffe9a3; opacity: .9; }
.nl-chest .nl-cbig { display: inline-flex; align-items: center; gap: calc(7 * var(--u)); padding: calc(5 * var(--u)) calc(14 * var(--u)) calc(5 * var(--u)) calc(8 * var(--u)); border-radius: calc(12 * var(--u)); border: 2px solid var(--ink, #14101e); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), 0 3px 0 var(--ink, #14101e); background: linear-gradient(180deg, #6c8cff, #3f5fd8); }
.nl-chest .nl-cbig .uic { width: calc(26 * var(--u)); height: calc(26 * var(--u)); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.nl-chest .nl-cbig b { font: 400 calc(19 * var(--u))/1 var(--font-head, 'Lilita One', sans-serif); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); white-space: nowrap; }
.nl-chest .nl-cnext.slot-gems .nl-cbig { background: linear-gradient(180deg, #34d6f0, #1690c8); }
.nl-chest .nl-cnext.slot-item .nl-cbig { background: linear-gradient(180deg, #ffd24a, #f08a1c); }
.nl-chest .nl-cnext.slot-item .nl-cbig b { color: #fff; }
.nl-chest.done .nl-cbig { filter: saturate(.85); }
.nl-chest .nl-ccyc { display: flex; gap: calc(4 * var(--u)); }
.nl-chest .nl-ccyc i { position: relative; display: grid; place-items: center; width: calc(24 * var(--u)); height: calc(24 * var(--u)); border-radius: calc(7 * var(--u)); background: rgba(0, 0, 0, .35); border: 1.5px solid rgba(255, 255, 255, .14); }
.nl-chest .nl-ccyc i .uic { width: calc(15 * var(--u)); height: calc(15 * var(--u)); }
.nl-chest .nl-ccyc i.past { opacity: .35; }
.nl-chest .nl-ccyc i.past::after { content: ''; position: absolute; right: calc(-3 * var(--u)); bottom: calc(-3 * var(--u)); width: calc(10 * var(--u)); height: calc(10 * var(--u)); border-radius: 50%; background: #5fd068 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.nl-chest .nl-ccyc i.now { background: rgba(255, 210, 74, .25); border-color: #ffd24a; box-shadow: 0 0 calc(8 * var(--u)) rgba(255, 210, 74, .7); transform: scale(1.12); }
.nl-chest .nl-ccyc i.c-item { background: rgba(255, 170, 40, .22); }
.nl-chest .nl-ccyc i.c-gems { background: rgba(52, 214, 240, .18); }
.nl-chest .nl-cclock { display: inline-flex; align-items: center; gap: calc(5 * var(--u)); padding: calc(4 * var(--u)) calc(10 * var(--u)); border-radius: 999px; background: rgba(0, 0, 0, 0.35); font: 900 calc(16 * var(--u))/1 var(--font-head, 'Lilita One', sans-serif); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.nl-chest .nl-cclock .uic { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }

/* v1.7.0 Christmas (html.xmas, 1 Dec – 6 Jan): snow over the lobby, a string of lights, a snow cap on the logo */
#xmSnow { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden;
  background-image: radial-gradient(circle, rgba(255,255,255,0.95) 0 1.6px, transparent 2.2px), radial-gradient(circle, rgba(255,255,255,0.8) 0 2.4px, transparent 3px), radial-gradient(circle, rgba(255,255,255,0.65) 0 1.2px, transparent 1.8px);
  background-size: 120px 120px, 210px 210px, 80px 80px; background-position: 0 0, 40px 60px, 20px 30px; animation: xmSnow 14s linear infinite; opacity: .85; }
@keyframes xmSnow { to { background-position: 30px 120px, 0px 270px, 40px 110px; } }
#xmGarland { position: absolute; left: 0; right: 0; top: 0; height: calc(46 * var(--u)); pointer-events: none; z-index: 3; }
#xmGarland svg { width: 100%; height: 100%; display: block; overflow: visible; }
#xmGarland .xm-b { animation: xmBlink 1.6s steps(2) infinite; }
#xmGarland .xm-b1 { animation-delay: .53s; } #xmGarland .xm-b2 { animation-delay: 1.06s; }
@keyframes xmBlink { 50% { opacity: .45; } }
html.xmas .nl-logo { position: absolute; }
html.xmas .nl-logo::before { content: ''; position: absolute; left: 50%; top: -0.22em; width: 5.6em; height: 0.42em; translate: -55% 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 42'%3E%3Cpath d='M8 30 C30 8 60 14 80 22 C100 6 140 10 160 24 C190 8 220 12 240 22 C262 6 300 10 320 24 C350 8 380 14 400 22 C430 6 470 10 490 24 C512 10 540 14 552 30 C540 38 520 34 500 38 C470 34 440 40 410 36 C380 40 340 34 310 38 C280 34 250 40 220 36 C190 40 150 34 120 38 C90 34 60 40 30 36 Z' fill='%23ffffff' stroke='%231d1a17' stroke-width='5' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
html.xmas .nl-logo::after { content: ''; position: absolute; left: calc(50% + 2.05em); top: -0.34em; width: 0.9em; height: 0.6em; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath d='M30 22 C22 8 8 6 2 14 C8 16 10 20 8 24 C16 22 24 24 30 22Z M30 22 C38 8 52 6 58 14 C52 16 50 20 52 24 C44 22 36 24 30 22Z' fill='%232f9e4a' stroke='%231d1a17' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='25' cy='26' r='6' fill='%23e5263c' stroke='%231d1a17' stroke-width='2.5'/%3E%3Ccircle cx='35' cy='26' r='6' fill='%23e5263c' stroke='%231d1a17' stroke-width='2.5'/%3E%3Ccircle cx='30' cy='32' r='6' fill='%23e5263c' stroke='%231d1a17' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat; }
html.xmas .nl-play { box-shadow: inset 0 0 0 3px rgba(255,255,255,0.15), 0 0 0 0 transparent; }
#shopTabs .tab-xmas { background: linear-gradient(180deg, #e5263c, #a8121f) !important; color: #fff !important; display: inline-flex; align-items: center; gap: 6px; }
#shopTabs .tab-xmas .uic { width: 20px; height: 20px; }
#shopTabs .tab-xmas.on { box-shadow: 0 0 0 3px #ffd24a, 0 0 16px rgba(255, 80, 90, 0.7) !important; }
.sh-section .xm-h { color: #ff6b6b; }
.sh-section .xm-sale { display: inline-block; margin-inline-start: 8px; padding: 2px 10px; border-radius: 999px; background: #ffd24a; color: #5a0e0e; font-size: 13px; }
.sh-was { color: #ff9aa2; text-decoration: line-through; margin-inline-end: 5px; font-size: .85em; opacity: .9; }
@media (prefers-reduced-motion: reduce) { #xmSnow, #xmGarland .xm-b { animation: none; } }
/* v1.7.0b room for the reward chip and the cycle: a smaller chest, tighter rows */
.nl-chest { gap: calc(4 * var(--u)); }
.nl-chest .nl-cic { width: calc(92 * var(--u)); height: calc(70 * var(--u)); }
.nl-chest .nl-ct { font-size: calc(21 * var(--u)); line-height: 1; }
.nl-chest .nl-open { margin-top: calc(2 * var(--u)); }
/* v1.7.0b short screens (phones): the chest card keeps one row of each — a small chest, the chip, the clock; the cycle row hides */
@media (max-height: 560px) {
  .nl-chest { gap: calc(2 * var(--u)); justify-content: flex-end; padding-bottom: calc(10 * var(--u)); }
  .nl-chest .nl-cic { width: calc(64 * var(--u)); height: calc(46 * var(--u)); }
  .nl-chest .nl-ct { font-size: calc(17 * var(--u)); }
  .nl-chest .nl-cnl { display: none; }
  .nl-chest .nl-ccyc { display: none; }
  .nl-chest .nl-cbig { padding: calc(3 * var(--u)) calc(10 * var(--u)) calc(3 * var(--u)) calc(6 * var(--u)); }
  .nl-chest .nl-cbig .uic { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
  .nl-chest .nl-cbig b { font-size: calc(16 * var(--u)); }
  .nl-chest .nl-cclock { font-size: calc(14 * var(--u)); padding: calc(3 * var(--u)) calc(8 * var(--u)); }
}

/* ---------------- v1.7.0c the Christmas countdown (Xmas.countdown) — the 14 days before 1 December ---------------- */
.nl-xmc { position: absolute; left: 50%; top: calc(246 * var(--u)); transform: translateX(-50%); display: flex; align-items: center; gap: calc(10 * var(--u)); height: calc(50 * var(--u)); padding: 0 calc(16 * var(--u)) 0 calc(6 * var(--u));
  border: 3px solid var(--ink); border-radius: 999px; cursor: pointer; color: var(--cream); font-family: var(--font-display); white-space: nowrap;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 calc(10 * var(--u)), rgba(255, 255, 255, 0) calc(10 * var(--u)) calc(20 * var(--u))), linear-gradient(180deg, #e8424a, #a3172a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 5px 0 var(--ink), 0 10px 22px rgba(0, 0, 0, 0.35); transition: transform 0.08s ease, filter 0.15s ease; }
.nl-xmc.hidden { display: none; }
.nl-xmc:hover { filter: brightness(1.08); }
.nl-xmc:active { transform: translateX(-50%) translateY(3px); }
.nl-xmc .xmc-ic { width: calc(38 * var(--u)); height: calc(38 * var(--u)); flex: none; border-radius: 50%; border: 3px solid var(--ink); padding: calc(4 * var(--u)); background: radial-gradient(circle at 50% 35%, #fff3b0, #ffc832 60%, #e0901a); animation: xmcBob 2.4s ease-in-out infinite; }
.nl-xmc .xmc-t { display: flex; flex-direction: column; line-height: 1; align-items: flex-start; }
.nl-xmc .xmc-t b { font-size: calc(22 * var(--u)); text-shadow: var(--nl-out-s); }
.nl-xmc .xmc-t small { font: 900 calc(12 * var(--u)) var(--font-body); color: #ffe08a; letter-spacing: 0.3px; text-transform: uppercase; }
.nl-xmc .xmc-d { display: flex; align-items: baseline; gap: calc(4 * var(--u)); padding: calc(2 * var(--u)) calc(10 * var(--u)); border-radius: 999px; background: rgba(0, 0, 0, 0.32); border: 2px solid rgba(0, 0, 0, 0.35); }
.nl-xmc .xmc-d.hidden { display: none; }
.nl-xmc .xmc-d b { font-size: calc(26 * var(--u)); color: #ffd84a; text-shadow: var(--nl-out-s); }
.nl-xmc .xmc-d small { font: 900 calc(13 * var(--u)) var(--font-body); color: var(--cream); }
.nl-xmc .xmc-clk, .xmp-clk span, .end-chest .ec-clk { direction: ltr; unicode-bidi: isolate; }
.nl-xmc .xmc-clk { font-size: calc(24 * var(--u)); font-variant-numeric: tabular-nums; text-shadow: var(--nl-out-s); min-width: 4.2em; text-align: center; }
.nl-xmc.last .xmc-clk { color: #ffd84a; font-size: calc(28 * var(--u)); }
.nl-xmc.last { animation: xmcPulse 1.4s ease-in-out infinite; }
@keyframes xmcBob { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-2px); } }
@keyframes xmcPulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.15) drop-shadow(0 0 10px rgba(255, 216, 74, 0.7)); } }
/* a brand-new kingdom sees PLAY first (its lobby is calmer); the Academy's lobby never shows it */
#nlobby.fresh .nl-xmc { display: none; }
@media (max-height: 560px) {
  /* no logo on a short screen: the chip sits in the top bar, between the profile and the wallet */
  .nl-xmc { top: calc(22 * var(--u)); height: calc(46 * var(--u)); gap: calc(7 * var(--u)); padding: 0 calc(12 * var(--u)) 0 calc(5 * var(--u)); left: var(--xmc-x, 50%); }
  .nl-xmc.tight2 .xmc-d small { display: none; }
  .nl-xmc .xmc-ic { width: calc(32 * var(--u)); height: calc(32 * var(--u)); }
  .nl-xmc .xmc-t small { display: none; }
  .nl-xmc .xmc-t b { font-size: calc(18 * var(--u)); max-width: calc(96 * var(--u)); overflow: hidden; text-overflow: ellipsis; }
  .nl-xmc .xmc-d b { font-size: calc(22 * var(--u)); }
  .nl-xmc .xmc-d small { font-size: calc(11 * var(--u)); }
  .nl-xmc .xmc-clk { font-size: calc(20 * var(--u)); }
  /* the site's full-screen hint moves to the bottom-left corner while the countdown is up */
  html.ui-new.xm-cd .full-hint { top: auto !important; bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important; left: max(10px, env(safe-area-inset-left, 0px)) !important; transform: none !important; }
}
/* the CrazyGames guest's "Sign in" chip leaves less room up there: the name goes, the gift says it */
@media (max-height: 560px) { .nl-xmc.tight .xmc-t { display: none; } .nl-xmc.cramped .xmc-d { display: none; } }
/* Playgama: the logo carries "KINGDOMS" under it there, so the chip always sits in the top bar's gap (Xmas.fitTop) */
html.pg .nl-xmc { top: calc(22 * var(--u)); left: var(--xmc-x, 50%); }
html.pg .nl-xmc.tight .xmc-t { display: none; } html.pg .nl-xmc.tight2 .xmc-d small { display: none; } html.pg .nl-xmc.cramped .xmc-d { display: none; }

/* what is coming (Xmas.preview) */
.xmp { z-index: 905; background: radial-gradient(ellipse at 50% 40%, rgba(120, 10, 25, 0.55), rgba(5, 8, 14, 0.82)); animation: fadeIn 0.2s ease; }
.xmp-card { position: relative; width: min(600px, 100%); max-height: calc(var(--vh100, 100vh) - 24px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 12px; padding: 16px 18px 18px; border-radius: 24px; border: 3px solid var(--ink, #1d1a17); color: var(--cream, #fff8e6);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 216, 74, 0.16), rgba(255, 216, 74, 0) 60%), linear-gradient(180deg, #2f3648, #1d2230); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 6px 0 var(--ink, #1d1a17), 0 20px 50px rgba(0, 0, 0, 0.5); animation: xmpIn 0.32s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes xmpIn { from { transform: scale(0.88); opacity: 0; } to { transform: none; opacity: 1; } }
.xmp-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--ink, #1d1a17); background: #46506a; color: #fff; font: 400 24px/1 var(--font-display); cursor: pointer; }
.xmp-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.xmp-hic { width: 54px; height: 54px; flex: none; border-radius: 50%; border: 3px solid var(--ink, #1d1a17); padding: 7px; background: radial-gradient(circle at 50% 35%, #fff3b0, #ffc832 60%, #e0901a); }
.xmp-head h2 { margin: 0; font: 400 32px/1 var(--font-display); letter-spacing: 0.4px; text-shadow: var(--nl-out-s); }
.xmp-head small { font-weight: 900; color: #ffe08a; }
.xmp-clk { justify-self: center; display: flex; align-items: baseline; gap: 8px; padding: 6px 18px; border-radius: 999px; border: 3px solid var(--ink, #1d1a17); background: linear-gradient(180deg, #e8424a, #a3172a); font-family: var(--font-display); }
.xmp-clk b { font-size: 34px; color: #ffd84a; text-shadow: var(--nl-out-s); }
.xmp-clk small { font: 900 15px var(--font-body); margin-right: 6px; }
.xmp-clk span { font-size: 30px; font-variant-numeric: tabular-nums; text-shadow: var(--nl-out-s); }
.xmp-pass { border-radius: 18px; border: 3px solid var(--ink, #1d1a17); padding: 10px 12px 12px; background: linear-gradient(180deg, rgba(195, 155, 255, 0.22), rgba(116, 71, 222, 0.18)); }
.xmp-pt { display: flex; align-items: center; justify-content: center; gap: 8px; font: 400 22px var(--font-display); text-shadow: var(--nl-out-s); }
.xmp-pt .uic { width: 28px; height: 28px; }
.xmp-skins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.xmp-skins figure { margin: 0; display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.xmp-skins figure.elite { background: radial-gradient(circle at 50% 35%, rgba(255, 216, 74, 0.35), rgba(0, 0, 0, 0.25) 70%); box-shadow: inset 0 0 0 2px rgba(255, 216, 74, 0.6); }
.xmp-skins canvas { width: 118px; height: 118px; max-width: 100%; }
.xmp-skins figcaption { display: grid; justify-items: center; line-height: 1.1; text-align: center; }
.xmp-skins figcaption b { font: 400 18px var(--font-display); text-shadow: var(--nl-out-s); }
.xmp-skins figcaption small { font-weight: 900; font-size: 12px; color: var(--dimc, #c9c2b0); }
.xmp-skins figure.elite figcaption small { color: #ffd84a; }
.xmp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.xmp-t { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(0, 0, 0, 0.4); text-align: center; line-height: 1.15; min-width: 0; }
.xmp-t b { font: 400 17px var(--font-display); text-shadow: var(--nl-out-s); }
.xmp-t small { font-size: 12px; font-weight: 800; color: var(--dimc, #c9c2b0); }
.xmp-ti { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink, #1d1a17); padding: 7px; display: grid; place-items: center; }
.xmp-ti.snow { background: radial-gradient(circle at 50% 35%, #e9f7ff, #8fd0ff 70%); }
.xmp-ti.gift { background: radial-gradient(circle at 50% 35%, #ffd0d0, #e8424a 70%); }
.xmp-ti.sale { direction: ltr; unicode-bidi: isolate; width: auto; min-width: 46px; padding: 0 8px; border-radius: 999px; background: linear-gradient(180deg, var(--green1, #8ee04f), var(--green2, #3fa92a)); font: 400 18px var(--font-display); color: #fff; text-shadow: var(--nl-out-s); }
.xmp-ok { justify-self: center; min-width: 180px; }
@media (max-height: 660px) {
  /* a short screen: two columns — the Pass on the left; the clock, the three tiles and the button on the right */
  .xmp { padding: 6px; }
  .xmp-card { width: min(780px, 100%); grid-template-columns: 1fr 1fr; grid-template-areas: "head clk" "pass grid" "pass ok"; align-items: start; gap: 8px 12px; padding: 10px 14px 12px; }
  .xmp-head { grid-area: head; padding-right: 0; } .xmp-clk { grid-area: clk; justify-self: start; align-self: center; } .xmp-pass { grid-area: pass; align-self: stretch; } .xmp-grid { grid-area: grid; } .xmp-ok { grid-area: ok; justify-self: stretch; min-height: 44px; padding: 6px 12px; font-size: 20px; }
  .xmp-head h2 { font-size: 24px; }
  .xmp-hic { width: 40px; height: 40px; padding: 5px; }
  .xmp-clk { padding: 2px 12px; } .xmp-clk b { font-size: 24px; } .xmp-clk span { font-size: 22px; } .xmp-clk small { font-size: 12px; }
  .xmp-pass { padding: 8px 10px 10px; display: grid; align-content: center; }
  .xmp-skins canvas { width: 92px; height: 92px; }
  .xmp-grid { grid-template-columns: 1fr; align-content: start; gap: 6px; }
  .xmp-t { grid-template-columns: auto 1fr; grid-template-rows: auto auto; justify-items: start; text-align: start; column-gap: 8px; row-gap: 0; padding: 5px 8px; }
  .xmp-t .xmp-ti { grid-row: 1 / 3; width: 34px; height: 34px; padding: 5px; }
  .xmp-t .xmp-ti.sale { width: auto; min-width: 34px; font-size: 14px; padding: 0 5px; }
}

/* ---------------- v1.7.0c the end screen's next free chest (UINew.endChest), beside the house ---------------- */
html.ui-new .end-chest { display: inline-flex; align-items: center; gap: 8px; height: 76px; padding: 0 14px 0 8px; border-radius: 18px; border: 3px solid var(--ink); cursor: default; color: var(--cream); font-family: var(--font-body);
  background: linear-gradient(180deg, #46506a, #2b3245); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.2), inset 0 -5px 0 rgba(0, 0, 0, 0.2), 0 6px 0 var(--ink); }
html.ui-new .end-chest.hidden { display: none; }
html.ui-new .end-chest .ec-ic { width: 54px; height: 54px; flex: none; filter: grayscale(0.35) brightness(0.9); }
html.ui-new .end-chest .ec-txt { display: grid; justify-items: start; line-height: 1.05; gap: 2px; }
html.ui-new .end-chest small { font-size: 12px; font-weight: 900; color: var(--dimc); text-transform: uppercase; letter-spacing: 0.3px; }
html.ui-new .end-chest .ec-val { display: inline-flex; align-items: center; gap: 4px; }
html.ui-new .end-chest .ec-val .uic { width: 20px; height: 20px; }
html.ui-new .end-chest .ec-val b { font: 400 19px var(--font-display); text-shadow: var(--nl-out-s); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-new .end-chest .ec-val.slot-xp b { color: #9fe0ff; } html.ui-new .end-chest .ec-val.slot-gems b { color: #7ff3ff; } html.ui-new .end-chest .ec-val.slot-item b { color: #ffd84a; }
html.ui-new .end-chest .ec-clk { font: 400 17px var(--font-display); font-variant-numeric: tabular-nums; color: var(--cream); text-shadow: var(--nl-out-s); }
html.ui-new .end-chest.ready { cursor: pointer; background: linear-gradient(180deg, var(--gold1), var(--gold2)); animation: ecReady 1.6s ease-in-out infinite; }
html.ui-new .end-chest.ready .ec-ic { filter: none; }
html.ui-new .end-chest.ready small { color: #5a3300; }
html.ui-new .end-chest.ready .ec-clk { color: #fff; font-size: 20px; }
html.ui-new .end-chest.ready:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), 0 2px 0 var(--ink); }
@keyframes ecReady { 0%, 100% { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 6px 0 var(--ink); } 50% { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 6px 0 var(--ink), 0 0 22px rgba(255, 210, 70, 0.85); } }
html.ui-new .end-card.ec-tight .end-chest { height: 56px; gap: 6px; padding: 0 10px 0 6px; border-radius: 14px; }
html.ui-new .end-card.ec-tight .end-chest .ec-ic { width: 40px; height: 40px; }
html.ui-new .end-card.ec-tight .end-chest small { font-size: 10px; }
html.ui-new .end-card.ec-tight .end-chest .ec-val b { font-size: 16px; max-width: 110px; }
html.ui-new .end-card.ec-tight .end-chest .ec-clk { font-size: 15px; }
@media (prefers-reduced-motion: reduce) { html.ui-new .end-chest.ready, .nl-xmc .xmc-ic, .nl-xmc.last { animation: none; } }
