/* Đua Top Khu Phố 24/10–1/11: dải trong BXH + popup. Token lấy từ css/style.css; góc vuông, bóng lệch không blur. */
.lb-contest { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 3px solid var(--ink); background: linear-gradient(90deg, #e0457f, #ff8f1f); color: #fff; text-shadow: 1px 1px 0 #0007; }
.lb-contest.closed, .lb-contest.pending { background: linear-gradient(90deg, #4b3b66, #6a5a86); }
.lb-contest-t { flex: 1; min-width: 0; }
.lb-contest-t b { display: block; font: 800 13px/1.15 var(--display); }
.lb-contest-t small { display: block; font: 700 10.5px/1.25 var(--font); }
.lb-contest-cd { padding: 2px 7px; border: 2px solid #000; border-radius: 3px; background: #1b0f28; color: #ffd34d; font: 800 13px var(--display); text-shadow: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-contest .btn { min-height: 32px; flex: none; text-shadow: none; }
.lb-likes-note.decor { background: #e6f6dc; }
.lb-likes-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 4px; background: #ffe3ee; color: var(--ink); font: 600 12px/1.35 var(--font); box-shadow: 0 2px 0 var(--ink); }
.modal.contest-modal { width: min(420px, 100%); max-height: 100%; padding: 0; overflow: hidden; display: flex; flex-direction: column; background: #fff8ea; border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 6px 0 #0b0714, 0 0 0 3px #5a3a7a; }
.contest { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.contest-head { flex: none; position: relative; isolation: isolate; overflow: hidden; padding: 12px 14px 12px; text-align: center; background: #2b1740; border-bottom: 3px solid var(--ink); color: #fff; }
.contest-head::before { content: ''; position: absolute; inset: -60% -20%; z-index: -1; background: repeating-conic-gradient(from 0deg at 50% 70%, #2b1740 0 9deg, #46276a 9deg 18deg); }
.contest-head > small { display: block; font: 800 11px var(--display); letter-spacing: 3px; color: #ffb3cc; text-shadow: 1px 1px 0 #000; }
.contest-head h2 { margin: 2px 0 8px; font: 800 26px/1 var(--display); color: #ffd34d; text-shadow: 2px 2px 0 #000, 4px 4px 0 #0007; }
.contest-head p { margin: 6px 0 0; font: 700 12px/1.4 var(--font); }
.contest-head .x-btn, .contest-head [data-close] { position: absolute; right: 8px; top: 8px; }
.contest-when { display: flex; align-items: center; justify-content: center; gap: 8px; }
.contest-when span { padding: 4px 8px; border: 2px solid #000; border-radius: 3px; background: #1b0f28; }
.contest-when span.open { background: #e0457f; }
.contest-when small { display: block; font: 800 9px var(--display); letter-spacing: 2px; color: #ffe3ee; }
.contest-when b { display: block; font: 800 12.5px/1.2 var(--display); color: #ffd34d; }
.contest-when .open b { color: #fff; }
.contest-when i { font: 800 16px var(--display); font-style: normal; color: #ffd34d; }
.contest-cd { margin-top: 8px; }
.contest-cd small { display: block; font: 700 10px var(--font); color: #c9b6e4; }
.contest-cd b { display: inline-block; margin-top: 2px; padding: 2px 10px; border: 2px solid #000; border-radius: 3px; background: #1b0f28; color: #ffd34d; font: 800 20px var(--display); font-variant-numeric: tabular-nums; }
.contest-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; color: var(--ink); }
.contest-body h3 { margin: 12px 0 6px; font: 800 12px var(--display); letter-spacing: 1px; color: #a5480a; }
.contest-facts, .contest-ladder { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font: 600 12px/1.4 var(--font); }
.contest-facts li { display: flex; gap: 6px; align-items: flex-start; }
.contest-body h3 small { font: 600 10px var(--font); letter-spacing: 0; color: var(--ink-2); margin-left: 4px; }
.contest-ladder { display: flex; flex-direction: column; gap: 5px; }
.cl { border: 2px solid var(--ink); border-left-width: 6px; border-radius: 3px; background: #fffdf6; box-shadow: 0 2px 0 var(--ink); }
.cl.r1 { border-left-color: #ffd34d; } .cl.r2 { border-left-color: #c9d4e2; } .cl.r3 { border-left-color: #e9a46a; } .cl.r0 { border-left-color: #6fcf7a; }
.cl summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; cursor: pointer; list-style: none; font: 600 12px/1.3 var(--font); }
.cl summary::-webkit-details-marker { display: none; }
.cl summary b { flex: none; min-width: 78px; font: 800 12px var(--display); }
.cl summary span { flex: 1; min-width: 0; color: var(--ink-2); }
.cl summary::after { content: ''; flex: none; width: 0; height: 0; border: 5px solid transparent; border-left: 7px solid var(--ink); transition: transform .1s; }
.cl[open] summary::after { transform: rotate(90deg); }
.cl[open] summary { background: #fff3dc; border-bottom: 2px solid var(--ink); }
.cl summary:focus-visible { outline: 3px solid #56b8ff; outline-offset: -3px; }
.cl-d { padding: 8px 10px 10px; }
.cl-n { margin: 8px 0 0; font: 600 11px/1.4 var(--font); color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .cl summary::after { transition: none; } }
.contest .btn-row { flex: none; padding: 8px 12px 10px; border-top: 3px solid var(--ink); background: #fff3dc; }
@media (max-height: 720px) { .contest-head { padding: 8px 12px; } .contest-head h2 { font-size: 22px; margin-bottom: 4px; } .contest-head p { display: none; } .contest-cd { margin-top: 5px; } .contest-cd b { font-size: 17px; } }
@media (max-height: 460px) { .contest-head h2 { font-size: 20px; margin-bottom: 4px; } .contest-head p { display: none; } }

/* ---- Chọn bảng + ảnh skin hạng 1 ---- */
.cb-tabs { display: flex; gap: 4px; margin: 0 0 8px; overflow-x: auto; padding: 0 0 4px; }
.cb-tab { flex: none; min-height: 36px; padding: 2px 11px; border: 2px solid var(--ink); border-radius: 3px; background: #fff3dc; color: var(--ink); font: 800 11.5px var(--display); box-shadow: 0 2px 0 var(--ink); }
.cb-tab.on { background: linear-gradient(#ffe066, #ffb300); transform: translateY(-1px); }
.cb-hero { --gc: #ffb300; position: relative; margin: 0 0 8px; border: 3px solid #000; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 2px var(--gc); background: #111; }
.cb-hero.ur { --gc: #ff5fa8; }
.cb-hero img { display: block; width: 100%; aspect-ratio: 8 / 5; max-height: 34vh; object-fit: cover; object-position: center top; image-rendering: pixelated; }
.cb-rk { position: absolute; left: 6px; top: 6px; padding: 0 7px; border: 1.5px solid #000; border-radius: 2px; font: 800 11px/1.6 var(--display); color: #fff; text-shadow: 1px 1px 0 #0006; }
.cb-rk.ur { background: linear-gradient(#ff7ab8, #d93a85); } .cb-rk.ssr { background: linear-gradient(#ffc53a, #e08a00); color: var(--ink); text-shadow: none; }
.cb-hn { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, #000d); color: #fff; font: 800 15px/1.1 var(--display); text-shadow: 1px 1px 0 #000; }
.cb-hn small { display: block; margin-top: 2px; font: 600 10.5px/1.25 var(--font); color: #ffd9ec; }
/* ---- Ô vật phẩm ---- */
.cpx { display: inline-block; shape-rendering: crispEdges; image-rendering: pixelated; filter: drop-shadow(1px 0 0 #2a1c1c) drop-shadow(-1px 0 0 #2a1c1c) drop-shadow(0 1px 0 #2a1c1c) drop-shadow(0 -1px 0 #2a1c1c); }
.tg { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.it { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 58px; text-align: center; color: var(--ink); }
.itb { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid #000; border-radius: 3px; background: var(--ib, #fff); box-shadow: inset 0 2px 0 #fff8, inset 0 -5px 0 #0003, 0 2px 0 #000; overflow: hidden; }
.itb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.itb em { position: absolute; right: 0; bottom: 0; padding: 0 3px; background: #2a1c1c; color: #fff; font: 800 10px/1.35 var(--display); font-style: normal; border-top-left-radius: 3px; }
.it small { font: 700 9.5px/1.15 var(--font); max-width: 62px; overflow-wrap: anywhere; }
.it.sk { width: 84px; } .it.sk .itb { width: 80px; }
/* ---- Danh hiệu: ánh kim + vương miện + lấp lánh (Chí Tôn vàng, Bá Chủ bạc, Thống Lĩnh đồng, Cao Thủ ngọc, Tinh Anh thép) ---- */
.ttlrow { margin-top: 10px; }
.ctt { --glow: #ffd34d; --spark: #fff; position: relative; isolation: isolate; overflow: hidden; display: inline-flex; width: max-content; max-width: 100%; vertical-align: middle; margin: 0 3px; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; border: 2.5px solid #000; border-radius: 4px; font: 800 15px/1.2 var(--display); letter-spacing: 1.5px; color: #2a1c1c; text-shadow: 0 1px 0 #fff9; box-shadow: 0 3px 0 #000, 0 0 0 2px var(--glow), inset 0 2px 0 #fff9, inset 0 -4px 0 #0003; background-color: var(--c2); background-image: repeating-linear-gradient(115deg, transparent 0 9px, #ffffff55 9px 13px), linear-gradient(var(--c1), var(--c2) 55%, var(--c3)); background-size: 26px 100%, 100% 100%; animation: ttlSlide 2.4s steps(13) infinite, ttlGlow 1.4s steps(2) infinite alternate; }
.ctt b { position: relative; z-index: 1; color: #2a1c1c; font: inherit; letter-spacing: inherit; text-shadow: inherit; margin: 0; padding: 0; background: none; }
.ctt::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40px; width: 22px; background: linear-gradient(100deg, transparent, #fffc 50%, transparent); transform: skewX(-20deg); animation: ttlShine 2.6s steps(14) infinite; }
.cts { position: absolute; width: 2px; height: 2px; background: var(--spark); box-shadow: 0 -2px var(--spark), 0 2px var(--spark), -2px 0 var(--spark), 2px 0 var(--spark); animation: ttlTwinkle 1.2s steps(2) infinite; }
.cts.s1 { left: 9%; top: 24%; } .cts.s2 { left: 52%; top: 76%; animation-delay: .4s; } .cts.s3 { right: 11%; top: 26%; animation-delay: .8s; }
.ctt.g1 { --c1: #fff3a6; --c2: #ffcf33; --c3: #e09b00; --glow: #ffd34d; }
.ctt.g2 { --c1: #ffffff; --c2: #d4dde8; --c3: #8d9bb0; --glow: #9fd4ff; --spark: #e8f6ff; }
.ctt.g3 { --c1: #ffd9b0; --c2: #e9a46a; --c3: #b0622a; --glow: #ff9a4d; --spark: #ffe3b8; }
.ctt.g4 { --c1: #b8f5c6; --c2: #6fcf7a; --c3: #3d9a48; --glow: #6fcf7a; --spark: #e8ffee; font-size: 14px; animation: ttlSlide 3.2s steps(13) infinite; }
.ctt.g5 { --c1: #d6e4f4; --c2: #9db8d6; --c3: #6f8bb0; --glow: #6db4f0; font-size: 13px; animation: none; }
.ctt.g4::after, .ctt.g5::after { animation-duration: 4s; }
.ctt.g5::after { display: none; }
@keyframes ttlSlide { to { background-position: 26px 0, 0 0; } }
@keyframes ttlGlow { from { box-shadow: 0 3px 0 #000, 0 0 0 2px var(--glow), inset 0 2px 0 #fff9, inset 0 -4px 0 #0003; } to { box-shadow: 0 3px 0 #000, 0 0 0 4px var(--glow), inset 0 2px 0 #fff9, inset 0 -4px 0 #0003; } }
@keyframes ttlShine { to { left: 115%; } }
@keyframes ttlTwinkle { 50% { opacity: 0; transform: scale(.5); } }
@media (prefers-reduced-motion: reduce) { .ctt, .ctt::after, .cts { animation: none !important; } .ctt::after { display: none; } }
.ctt.wide { display: flex; width: auto; margin: 0; }
.ctt.sm { gap: 4px; padding: 2px 8px; border-width: 2px; border-radius: 3px; font-size: 10.5px; letter-spacing: .6px; box-shadow: 0 2px 0 #000, 0 0 0 1.5px var(--glow), inset 0 1px 0 #fff9, inset 0 -3px 0 #0003; }
.ctt .cpx { flex: none; }
@media (prefers-reduced-motion: reduce) { .ctt, .ctt::after, .cts { animation: none !important; } }
