/* $ALEC — shared: tokens, fonts, top bar, breaking ticker, buttons, live feed, toasts, footer */
@font-face { font-family: 'Huang'; src: url('/fonts/huang.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Brush'; src: url('/fonts/brush.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Unb'; src: url('/fonts/unb.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Man'; src: url('/fonts/man.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }

:root {
  --top: 70px; --crawl: calc(34px + env(safe-area-inset-bottom));
  --ink: #06070A; --ink2: #0C0E13; --panel: #12151B; --panel2: #181C24;
  --bnb: #F0B90B; --bnb2: #FCD535; --gold: #FFE7A0; --gold-d: #9A7206;
  --text: #EAECEF; --soft: #B7BDC6; --mute: #848E9C;
  --line: rgba(240, 185, 11, .16); --line2: rgba(240, 185, 11, .32);
  --red: #E8402C; --green: #2EBD85;
  --cn: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif;
  --body: 'Man', var(--cn);
  --disp: 'Unb', 'Huang', var(--cn);
  --huang: 'Huang', 'Unb', var(--cn);
  --brush: 'Brush', 'Huang', var(--cn);
  --r: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--text); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
html[data-lang="zh"] body { letter-spacing: .02em; }
img, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--bnb); color: #000; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* background: lacquer black with faint gold 祥云 clouds */
.bg-cloud { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(240, 185, 11, .10), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(240, 185, 11, .05), transparent 60%),
    var(--ink); }
.bg-cloud::after { content: ''; position: absolute; inset: 0; opacity: .05;
  background: url('/media/cloud.svg') 0 0 / 220px auto repeat; }

/* ------------------------------------------------------------------ chrome: floating mark (top left), hanging couplet (top right), news crawl (bottom) */
.mark { position: fixed; z-index: 41; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 9px; text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: radial-gradient(120% 140% at 0% 50%, rgba(6, 7, 10, .82), rgba(6, 7, 10, .35) 70%, transparent); }
.mark img { width: 42px; height: 42px; border-radius: 50%; animation: markspin 9s ease-in-out infinite; filter: drop-shadow(0 3px 10px rgba(240, 185, 11, .45)); }
@keyframes markspin { 0%, 70% { transform: rotateY(0); } 85% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
.mark span { display: grid; line-height: 1; }
.mark b { font: 900 16px/1 var(--disp); color: var(--bnb2); letter-spacing: .02em; }
.mark i { font: 400 13px/1.2 var(--huang); font-style: normal; color: var(--soft); letter-spacing: .3em; margin-top: 3px; }

/* the couplet: a red lacquer strip hanging from a gold rod; seal = language, gong = sound, diamond = X */
.couplet { position: fixed; z-index: 42; top: 0; right: max(10px, env(safe-area-inset-right)); width: 52px; display: grid; justify-items: center; gap: 9px; padding: 22px 0 16px;
  background: linear-gradient(90deg, #5E0F08, #8E1A0E 50%, #5E0F08); border: 1px solid rgba(252, 213, 53, .35); border-top: 0; border-radius: 0 0 6px 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55), inset 0 0 0 3px #6E1309, inset 0 0 0 4px rgba(252, 213, 53, .28);
  transform-origin: top center; transition: transform .55s cubic-bezier(.6, 0, .2, 1), padding .4s; }
.couplet::before { content: ''; position: absolute; top: 4px; left: -7px; right: -7px; height: 9px; border-radius: 5px; background: linear-gradient(#FFE27A, #B88606); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.couplet::after { content: ''; position: absolute; bottom: -26px; left: 50%; width: 4px; height: 26px; margin-left: -2px; background: linear-gradient(var(--bnb2), var(--red)); border-radius: 0 0 4px 4px;
  transform-origin: top center; animation: tassel 3.2s ease-in-out infinite; }
@keyframes tassel { 50% { transform: rotate(9deg); } }
.cp { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 0; padding: 0; background: none; cursor: pointer; text-decoration: none; color: var(--gold); -webkit-tap-highlight-color: transparent; }
.cp-drop { width: 36px; height: auto; padding: 7px 0; border-radius: 4px; background: linear-gradient(var(--bnb2), var(--bnb)); color: #2A1500; font: 400 17px/1.05 var(--huang); writing-mode: vertical-rl; letter-spacing: .1em; box-shadow: 0 0 14px rgba(240, 185, 11, .5); }
html[data-lang="en"] .cp-drop { font: 800 10.5px/1 var(--disp); letter-spacing: .12em; padding: 9px 0; }
/* seal stamp = language switch: it always shows the OTHER language (EN on the Chinese page, 中 on the English page) + a caption */
.seal { perspective: 300px; height: 52px; align-content: start; }
.seal .sf { position: absolute; left: 2px; right: 2px; top: 0; height: 32px; display: grid; place-items: center; border-radius: 3px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1);
  background: #F3E6C8; color: #B4200F; box-shadow: inset 0 0 0 2px #B4200F, inset 0 0 0 4px #F3E6C8, inset 0 0 0 5px #B4200F; }
.seal .zh { font: 900 12px/1 var(--disp); }
.seal .en { font: 400 19px/1 var(--huang); transform: rotateY(180deg); }
html[data-lang="en"] .seal .zh { transform: rotateY(-180deg); }
html[data-lang="en"] .seal .en { transform: rotateY(0); }
.seal:active .sf { filter: brightness(.9); }
.cp-cap { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font: 700 9px/1 var(--body); color: #FFE7A0; letter-spacing: .02em; white-space: nowrap; }
.seal::after { content: ''; position: absolute; inset: -3px -4px; border-radius: 6px; border: 1.5px solid rgba(255, 231, 160, .55); animation: sealhint 2.4s ease-in-out 3; pointer-events: none; opacity: 0; }
@keyframes sealhint { 30%, 60% { opacity: 1; } }
/* gong: swings while sound is on */
.gong svg { width: 30px; height: 30px; overflow: visible; }
.gong .disc { transform-origin: 16px 7px; animation: swing 2.6s ease-in-out infinite; }
@keyframes swing { 50% { transform: rotate(7deg); } }
.gong.off { color: #8C6A5E; }
.gong.off .disc { animation: none; opacity: .55; }
.gong .mute { display: none; }
.gong.off .mute { display: block; }
/* X: a gold diamond (the BNB shape) */
.dia::before { content: ''; position: absolute; inset: 6px; transform: rotate(45deg); border-radius: 4px; background: linear-gradient(135deg, #FFE27A, #C99406); box-shadow: 0 0 10px rgba(240, 185, 11, .4); }
.dia svg { position: relative; width: 13px; height: 13px; color: #2A1500; }
.cp-home svg { width: 20px; height: 20px; }
/* rolled up (landing, after the first screen): only the rod and the seal stay */
.couplet.rolled { padding-bottom: 8px; }
.couplet.rolled .cp:not(.seal):not(.cp-drop) { display: none; }

/* news crawl, like a TV channel (bottom) */
.ticker { position: fixed; left: 0; right: 0; bottom: 0; z-index: 43; height: calc(32px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: stretch;
  background: linear-gradient(#111317, #08090C); border-top: 2px solid var(--bnb); overflow: hidden; }
.tk-tag { flex: none; display: flex; align-items: center; gap: 7px; padding: 0 18px 0 max(12px, env(safe-area-inset-left)); background: var(--red); color: #fff;
  font: 400 15px/1 var(--huang); letter-spacing: .16em; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
html[data-lang="en"] .tk-tag { font: 800 11px/1 var(--disp); letter-spacing: .08em; }
.tk-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.tk-view { flex: 1; overflow: hidden; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tk-lane { display: flex; align-items: center; gap: 18px; white-space: nowrap; padding-left: 18px; animation: lane var(--dur, 40s) linear infinite; will-change: transform; }
.tk-lane span { font: 600 13px/1 var(--body); color: var(--gold); }
.tk-lane i { font-style: normal; color: var(--bnb); font-size: 8px; }
@keyframes lane { to { transform: translateX(-50%); } }
.tk-live { flex: none; display: flex; align-items: center; padding: 0 max(12px, env(safe-area-inset-right)) 0 10px; font: 800 10px/1 var(--disp); color: var(--bnb2); letter-spacing: .1em; background: #08090C; }
@media (prefers-reduced-motion: reduce) { .tk-lane, .mark img, .gong .disc, .couplet::after { animation: none; } }

/* ------------------------------------------------------------------ buttons */
.cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px; border-radius: 16px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #FFE27A, var(--bnb) 55%, #D9A406); color: #0B0B0B; text-decoration: none; font: 800 17px/1 var(--body);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 -2px 0 rgba(0, 0, 0, .18) inset, 0 12px 40px rgba(240, 185, 11, .35); position: relative; overflow: hidden; }
html[data-lang="zh"] .cta { font: 400 20px/1 var(--huang); letter-spacing: .08em; }
.cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%); transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.cta:active { transform: translateY(1px); }
.cta svg { width: 20px; height: 20px; }
.ghost { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line2); color: var(--gold); text-decoration: none; font: 700 15px/1 var(--body); background: rgba(240, 185, 11, .04); cursor: pointer; }

/* ------------------------------------------------------------------ live feed rows (both pages) */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(240, 185, 11, .05), rgba(255, 255, 255, .015)); border: 1px solid var(--line); }
.feed li.fresh { animation: fresh 1.4s ease-out; }
@keyframes fresh { 0% { background: rgba(240, 185, 11, .32); transform: translateY(-6px); } 100% { transform: none; } }
.feed .av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #2B2414; color: var(--bnb2); font: 800 16px/1 var(--disp); border: 1px solid var(--line2); }
.feed .av img { width: 100%; height: 100%; object-fit: cover; }
.feed .who { min-width: 0; }
.feed .who a { display: block; font-weight: 700; font-size: 15px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .who small { display: block; color: var(--mute); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .amt { color: var(--bnb2); font-weight: 800; }
.feed .tag { font: 700 12px/1 var(--body); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--soft); white-space: nowrap; text-decoration: none; }
.feed a.tag { color: #111; background: var(--bnb); border-color: var(--bnb); }
.feed .empty { display: block; text-align: center; color: var(--mute); padding: 26px 10px; grid-template-columns: none; }

/* pop-up when someone just got paid */
.pops { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: calc(var(--crawl) + 12px); z-index: 45; display: grid; gap: 8px; pointer-events: none; width: min(330px, calc(100vw - 24px)); }
.pop { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(18, 21, 27, .94); border: 1px solid var(--line2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: popin .45s cubic-bezier(.2, 1.4, .4, 1), popout .4s ease-in 4.2s forwards; backdrop-filter: blur(8px); }
.pop .av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #2B2414; color: var(--bnb2); font: 800 14px var(--disp); }
.pop .av img { width: 100%; height: 100%; object-fit: cover; }
.pop p { margin: 0; font-size: 13.5px; line-height: 1.35; }
.pop b { color: var(--bnb2); }
@keyframes popin { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes popout { to { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ toast */
.toast { position: fixed; left: 50%; top: calc(var(--top) + 6px); z-index: 60; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line2); font-weight: 600; font-size: 14.5px; max-width: calc(100vw - 28px); text-align: center;
  transition: .3s; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(232, 64, 44, .6); }

.sparks { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 50; pointer-events: none; }

/* ------------------------------------------------------------------ footer */
.foot { position: relative; padding: 46px 18px calc(40px + var(--crawl)); border-top: 1px solid var(--line); text-align: center; color: var(--mute); font-size: 13.5px; background: #050608; }
.foot .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.foot img { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 12px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--soft); }

/* reveal on scroll */
[data-rv] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
[data-rv].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-rv] { opacity: 1; transform: none; transition: none; } .cta::after { animation: none; } }

.mark.mini { background: none; padding-right: 4px; }
.mark.mini span { display: none; }
