/*
 * Self-contained styles for embeddable server widgets (card + vote variants).
 *
 * These render inside a cross-origin <iframe> on third-party sites, isolated
 * from app.css, so this file is fully standalone: its own reset, hard-coded
 * brand palette (no CSS custom properties from the main app resolve here) and
 * system font stack. Keep it small — every embedder downloads it.
 */

.sw-body {
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: oklch(0.98 0 0);
}

.sw-body *,
.sw-body *::before,
.sw-body *::after { box-sizing: border-box; }

/* Shared bits --------------------------------------------------------- */
.sw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.sw-dot--online  { background: oklch(0.78 0.17 145); box-shadow: 0 0 0 3px oklch(0.78 0.17 145 / 0.2); }
.sw-dot--offline { background: oklch(0.7 0.04 150); }

.sw-ico { width: 14px; height: 14px; flex-shrink: 0; vertical-align: -2px; }

/* Compact "classic" banner (468x60) ----------------------------------- */
.sw-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: 56px;
    padding: 8px 12px;
    background: linear-gradient(135deg, oklch(0.22 0.04 150), oklch(0.27 0.05 150));
    border: 1px solid oklch(0.32 0.008 150);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.sw-banner:hover { filter: brightness(1.06); }
.sw-banner__logo {
    width: 40px;
    height: 40px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
}
.sw-banner__logo--placeholder {
    display: grid;
    place-items: center;
    background: oklch(0.3 0.03 150);
    font-weight: 700;
    font-size: 18px;
}
.sw-banner__id { min-width: 0; flex: 1; }
.sw-banner__host {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-banner__sub {
    font-size: 10.5px;
    color: oklch(0.78 0.015 150);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-banner__stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 11.5px;
    color: oklch(0.82 0.015 150);
}
.sw-banner__stats .sw-stat { white-space: nowrap; }
.sw-banner__cta {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 6px;
    background: oklch(0.78 0.17 145);
    color: oklch(0.18 0.05 150);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 380px) {
    .sw-banner__stats { display: none; }
}

/* Card variant -------------------------------------------------------- */
.sw-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-height: 100%;
    padding: 14px;
    background: linear-gradient(135deg, oklch(0.22 0.04 150), oklch(0.27 0.05 150));
    border: 1px solid oklch(0.32 0.008 150);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.sw-card:hover { filter: brightness(1.06); }

.sw-card__head { display: flex; align-items: center; gap: 10px; }
.sw-card__logo {
    width: 40px;
    height: 40px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
}
.sw-card__logo--placeholder {
    display: grid;
    place-items: center;
    background: oklch(0.3 0.03 150);
    font-weight: 700;
    font-size: 18px;
}
.sw-card__id { flex: 1; min-width: 0; }
.sw-card__name {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-card__host {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: oklch(0.72 0.02 150);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-card__sub {
    font-size: 11.5px;
    color: oklch(0.78 0.015 150);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-card__motd {
    font-size: 11.5px;
    line-height: 1.35;
    color: oklch(0.78 0.015 150);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sw-card__foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    font-size: 12px;
    color: oklch(0.82 0.015 150);
}
.sw-stat { display: inline-flex; align-items: center; gap: 4px; }
.sw-card__cta {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 6px;
    background: oklch(0.78 0.17 145);
    color: oklch(0.18 0.05 150);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Vote variant -------------------------------------------------------- */
.sw-vote {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-height: 100%;
    padding: 14px;
    background: linear-gradient(135deg, oklch(0.22 0.04 150), oklch(0.27 0.05 150));
    border: 1px solid oklch(0.32 0.008 150);
    border-radius: 8px;
    text-align: center;
}
.sw-vote__head { display: flex; align-items: center; gap: 9px; text-align: left; }
.sw-vote__logo { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.sw-vote__logo--placeholder {
    display: grid;
    place-items: center;
    background: oklch(0.3 0.03 150);
    font-weight: 700;
    font-size: 15px;
    color: oklch(0.98 0 0);
}
.sw-vote__id { min-width: 0; }
.sw-vote__name {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-vote__host { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.sw-vote__host {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10.5px;
    color: oklch(0.72 0.02 150);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sw-vote__count { display: flex; align-items: baseline; justify-content: center; gap: 5px; }
.sw-vote__num { font-size: 24px; font-weight: 800; line-height: 1; }
.sw-vote__label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: oklch(0.72 0.02 150);
}
.sw-vote__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
    padding: 9px 12px;
    border-radius: 6px;
    background: oklch(0.78 0.17 145);
    color: oklch(0.18 0.05 150);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.sw-vote__cta:hover { filter: brightness(1.06); }
