/* 裝飾品（ui/deco.js 畫的）：頭像框、名字特效、徽章、訊息泡泡、個人頁背景。App 和管理後台共用 */

/* 像素字體：Pixelify Sans（SIL Open Font License，見 fonts/OFL.txt），只有英文字母，中文用一般字體 */
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/PixelifySans.woff2') format('woff2'); }

/* ---------- 頭像框：框畫在頭像外面，不改變頭像佔的大小 ---------- */
.deco-av { position: relative; display: inline-block; flex: none; vertical-align: middle; line-height: 0; }
.deco-av > .avatar { position: relative; z-index: 1; display: inline-flex; }
.deco-fx { position: absolute; pointer-events: none; z-index: 2; }
.deco-ring { border-radius: 50%; }
.deco-neon { border-radius: 50%; border-style: solid; box-shadow: 0 0 10px var(--deco-c), 0 0 20px color-mix(in srgb, var(--deco-c) 45%, transparent), inset 0 0 8px color-mix(in srgb, var(--deco-c) 60%, transparent); animation: deco-neon 1.8s ease-in-out infinite; }
.deco-svgfill { width: 100%; height: 100%; display: block; }
.deco-sq > .avatar { border-radius: 10%; }
.deco-hex > .avatar { border-radius: 0; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.deco-orbit { animation: deco-spin 3.2s linear infinite; }
.deco-orbit::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--deco-c) 55%, transparent); }
.deco-arm { position: absolute; inset: 0; }
.deco-arm::after { content: ""; position: absolute; left: 50%; top: 0; width: 13%; height: 13%; margin-left: -6.5%; border-radius: 50%; background: var(--deco-c); box-shadow: 0 0 6px var(--deco-c); }
.deco-crystal { z-index: 0; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); overflow: hidden; }
.deco-crystal::after { content: ""; position: absolute; top: -40%; bottom: -40%; left: -60%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); transform: rotate(20deg); animation: deco-shine var(--deco-t, 2.8s) ease-in-out infinite; }
.deco-crystal.deco-still::after { display: none; }
.deco-flame { z-index: 0; }
.deco-glow { border-radius: 50%; border: 1.5px solid; }

/* ---------- 名字 ---------- */
.deco-name-row { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
/* 太長用「…」；clip 加上外距，霓虹光暈、外光不會被裁成方塊 */
.deco-name-row > .deco-name { min-width: 0; overflow: clip; overflow-clip-margin: 16px; text-overflow: ellipsis; white-space: nowrap; }
.deco-badge { flex: none; display: inline-block; vertical-align: -0.15em; }
.deco-clip { -webkit-background-clip: text; background-clip: text; color: transparent !important; background-size: 200% 100%; }
.deco-pixel { font-family: 'Pixelify Sans', "Microsoft JhengHei UI", "Segoe UI", system-ui, sans-serif; letter-spacing: .02em; }
.deco-flicker { animation: deco-flicker 4s linear infinite; }
.deco-glitch { animation: deco-glitch 2.6s steps(1) infinite; }

/* ---------- 訊息泡泡 ---------- */
.deco-bubble a, .deco-bubble .mention { color: inherit; }
.deco-pixel-box { border-radius: 0 !important; }

/* ---------- 個人頁背景 ---------- */
.deco-banner { display: block; width: 100%; height: 100%; }

@keyframes deco-spin { to { transform: rotate(360deg); } }
@keyframes deco-hue { to { filter: hue-rotate(360deg); } }
@keyframes deco-neon { 50% { opacity: .7; box-shadow: 0 0 4px var(--deco-c), inset 0 0 4px color-mix(in srgb, var(--deco-c) 40%, transparent); } }
@keyframes deco-shine { 0%, 40% { left: -60%; } 100% { left: 130%; } }
@keyframes deco-flow { to { background-position: 200% 0; } }
@keyframes deco-stripes { to { background-position: 28.28px 0; } }
@keyframes deco-flicker { 0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 63% { opacity: .55; } }
@keyframes deco-glitch { 0%, 90%, 100% { text-shadow: none; transform: none; } 92% { text-shadow: -2px 0 var(--deco-a), 2px 0 var(--deco-b); transform: translateX(1px); } 95% { text-shadow: 2px 0 var(--deco-a), -2px 0 var(--deco-b); transform: translateX(-1px); } }

@media (prefers-reduced-motion: reduce) {
  .deco-fx, .deco-fx::before, .deco-fx::after, .deco-name, .deco-bubble { animation: none !important; }
}
/* 頭像框畫在頭像外面：不管放在哪裡（個人連結、Addon 卡片的作者等會把 span 裁切的地方）都不能被裁掉，不然會變成方形 */
.deco-av { overflow: visible !important; text-overflow: clip !important; }
/* 名字特效的光暈同理：太長還是用「…」，但留外距給光暈 */
.deco-name, .deco-name-row { overflow: clip !important; overflow-clip-margin: 16px; }
