/* btw.bio — live widget cards and embeds. Shared by profile pages and the dashboard preview.
   Uses the page theme variables (--radius, --text, --bg, --accent, --grad). */
@keyframes w-in { from { opacity: 0; transform: translateY(12px); } }
/* Dimmed text in the theme colour. Transparency alone turns a saturated colour (red, blue) into an unreadable
   dark shade on a dark page, so a light text colour keeps its lightness and loses some saturation instead; a dark
   text colour (light page) is still dimmed with transparency. Re-declared where --text changes. */
:root, .widget, .widget-stage, .fx-stage {
  --text-2: color-mix(in srgb, var(--text) 84%, transparent);
  --text-3: color-mix(in srgb, var(--text) 58%, transparent);
}
@supports (color: oklch(from red calc(l * 0.5) c h / 0.5)) {
  :root, .widget, .widget-stage, .fx-stage {
    --text-2: oklch(from var(--text) max(calc(l * 0.86), min(l, 0.8)) calc(c * (1 - 0.15 * clamp(0, (l - 0.45) * 100, 1))) h / calc(0.84 + 0.16 * clamp(0, (l - 0.45) * 100, 1)));
    --text-3: oklch(from var(--text) max(calc(l * 0.7), min(l, 0.68)) calc(c * (1 - 0.45 * clamp(0, (l - 0.45) * 100, 1))) h / calc(0.58 + 0.42 * clamp(0, (l - 0.45) * 100, 1)));
  }
}
.widgets { display: grid; gap: 10px; margin-top: 20px; text-align: start; }
.widget {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; overflow: hidden;
  border-radius: calc(var(--radius) * 0.65); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07);
  animation: w-in 0.5s ease both;
}
.widget.is-loading { justify-content: center; }
/* Background styles (per widget): card (default), clear, theme */
.widget.wbg-clear { background: transparent; border-color: transparent; }
/* Owner-picked colour (--wbg comes from the page stylesheet, or CSSOM in the dashboard). Light colours get dark text. */
.widget.wbg-color { background: var(--wbg, #27272a); border-color: color-mix(in srgb, var(--wbg, #27272a) 78%, #ffffff 22%); }
.widget.wfg-dark { --text: #0b0b0f; color: #0b0b0f; border-color: color-mix(in srgb, var(--wbg, #ffffff) 82%, #000000 18%); }
.widget.wfg-dark .w-action, .widget.wfg-dark .w-chip, .widget.wfg-dark .w-tag { background: rgba(0, 0, 0, 0.08); border-color: rgba(0, 0, 0, 0.14); color: #0b0b0f; }
.widget.wfg-dark .w-action:hover { background: rgba(0, 0, 0, 0.14); }
.w-skeleton { position: absolute; inset: 12px 48px 12px 14px; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)); background-size: 200% 100%; animation: w-shimmer 1.3s infinite; }
@keyframes w-shimmer { to { background-position: -200% 0; } }
.widget.is-error { min-height: 56px; color: var(--text-3); font-size: 13.5px; }
/* The platform's own logo, full strength: at 17px and 70% opacity the brand colours (Discord's blurple on black)
   looked faint and thin on Windows screens. Same size as the Discord badges below. */
.w-brand { position: absolute; top: 10px; inset-inline-end: 10px; pointer-events: none; line-height: 0; }
.w-brand .icon { width: 20px; height: 20px; }
.w-media { flex: none; display: grid; place-items: center; }
.w-avatar { position: relative; width: 50px; height: 50px; }
.w-avatar img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; background: rgba(0, 0, 0, 0.3); }
.w-letter { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; font-size: 21px; font-weight: 700; line-height: 1; }
.w-letter-kick { background: #53fc18; color: #0b0e0f; }
.w-avatar .w-dot { position: absolute; inset-inline-end: -1px; bottom: -1px; width: 15px; height: 15px; border: 3px solid color-mix(in srgb, var(--bg) 85%, #000); }
.w-icon { width: 50px; height: 50px; border-radius: 13px; object-fit: cover; background: rgba(0, 0, 0, 0.3); }
.w-icon.round { border-radius: 50%; }
.w-icon.pixel { image-rendering: pixelated; border-radius: 8px; }
.w-initial { display: grid; place-items: center; font-weight: 700; font-size: 22px; background: linear-gradient(135deg, var(--accent), var(--grad)); color: #fff; }
.w-cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.8); }
.w-art { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; }
.w-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
/* The platform logo sits in the top corner (.w-brand, 20px): its column is kept free, so a Join / View button or long
   text never runs into it. */
.widget:has(> .w-brand) { padding-inline-end: 32px; }
.w-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Name + verified tick: the name shortens first, the tick always stays visible. */
.w-name { display: flex; align-items: center; gap: 5px; }
.w-name > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.w-name .w-verified { flex: none; }
.w-title.mono { font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 14px; }
/* Discord badge tooltips may leave the card; the hovered card sits above its neighbours. */
.widget.w-discord { overflow: visible; }
.widget:hover, .widget:focus-within { z-index: 5; }
.w-dbadges { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 1px 0 2px; }
.w-dbadge-wrap { display: inline-grid; place-items: center; border-radius: 6px; outline-offset: 2px; }
.w-dbadge { width: 20px; height: 20px; object-fit: contain; display: block; }
/* Server tag next to the Discord name */
.w-tag { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; padding: 0 6px 0 4px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 18px; color: var(--text); background: rgba(255, 255, 255, 0.09); vertical-align: 1px; }
.w-tag-badge { width: 14px; height: 14px; object-fit: contain; display: block; }
/* Discord avatar decoration over the picture */
.w-avatar img.w-deco { position: absolute; left: -10%; top: -10%; width: 120%; height: 120%; border-radius: 0; background: none; object-fit: contain; pointer-events: none; z-index: 1; }
.w-avatar .w-dot { z-index: 2; }
.w-sub { font-weight: 500; font-size: 13px; color: var(--text-3); }
.w-line { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-line b { color: var(--text); font-weight: 600; }
/* Discord custom status emoji (a server emoji drawn from /dimg/emojis). */
.w-emoji { display: inline-block; width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; }
.w-line.faint { color: var(--text-3); font-size: 12.5px; }
.w-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #747f8d; vertical-align: 0; }
.w-dot[data-state="online"] { background: #23a55a; }
.w-dot[data-state="idle"] { background: #f0b232; }
.w-dot[data-state="dnd"] { background: #f23f43; }
.w-dot[data-state="ingame"] { background: #3b82f6; }
.w-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 2px; }
/* Two counts that always stay side by side (Pinterest: pins left, followers right). */
.w-stats.w-pair { flex-wrap: nowrap; }
.w-stat { display: inline-flex; align-items: baseline; gap: 5px; font-size: 13px; }
.w-stat b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.w-stat small { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.w-action { flex: none; align-self: center; padding: 6px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); transition: background 0.15s, border-color 0.15s; margin-inline-end: 14px; }
.w-action:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.18); }
.w-clock { flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
.w-clock .w-title { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.w-clock-time { font-size: 28px; font-weight: 600; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.w-countdown { flex-direction: column; justify-content: center; gap: 6px; text-align: center; }
.w-countdown .w-title { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.w-cd-row { display: flex; justify-content: center; gap: 10px; }
.w-cd-cell { display: grid; justify-items: center; min-width: 52px; }
.w-cd-cell b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.w-cd-cell small { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.w-cd-done { font-size: 20px; font-weight: 600; }
.widget-embed { display: block; min-height: 0; padding: 0; background: rgba(0, 0, 0, 0.25); }
.widget-embed iframe { width: 100%; border: 0; border-radius: inherit; background: transparent; }
.widget-embed.ratio { aspect-ratio: 16 / 9; }
.widget-embed.ratio iframe { height: 100%; }
.w-soundcloud iframe { border-radius: 0; }


/* Kick: verified mark and live state */
.w-verified { display: inline-block; width: 15px; height: 15px; margin-inline-start: 5px; vertical-align: -2px; flex: none; }
.w-dot[data-state="live"] { background: #53fc19; box-shadow: 0 0 8px rgba(83, 252, 25, 0.6); }
.w-live { display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; color: #0b0b0f; background: #53fc19; vertical-align: 1px; }
/* Game ranks (Valorant, LoL, TFT) */
.w-chip { display: inline-block; margin-inline-start: 7px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 18px; color: var(--text-3); background: rgba(255, 255, 255, 0.08); vertical-align: 1px; }
.w-rank { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; }
.w-rank-icon { width: 30px; height: 30px; object-fit: contain; flex: none; }
.w-rank-text { display: grid; min-width: 0; line-height: 1.25; }
.w-rank-text b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-rank-text small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-valorant .w-icon, .w-lol .w-icon, .w-tft .w-icon { width: 56px; height: 56px; }

/* Cards with a link: the whole card opens it (the button stretches over the card, so taps anywhere count). */
.widget.w-has-link { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.widget.w-has-link:hover { border-color: rgba(255, 255, 255, 0.16); }
.widget.w-has-link .w-action::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.widget.w-has-link .w-action:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 80%, transparent); outline-offset: 2px; }

/* Widgets that open a profile when clicked (profile-widgets.js openOnClick). */
.widget.w-clickable { cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease; }
/* No lift: the clickable widget stays in line with the others, only the border shows the hover. */
.widget.w-clickable:hover { border-color: color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, 0.12)); }

/* Discord widget of an account not in our server: the join line (profile-widgets.js) */
.w-join { white-space: normal; line-height: 1.45; }
.w-join-link { color: #5865f2; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* Weather (profile-widgets.js weather) */
.w-wx { display: grid; place-items: center; color: #fff; }
.w-wx svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
