/* Server discovery (/minecraft-servers) - list + profile pages.
   Soft luminous surfaces, color accents, no borders, no hover movement. */

:root {
    --msl-surface: rgba(30, 41, 59, 0.55);
    --msl-surface-hover: rgba(36, 50, 73, 0.8);
    --msl-surface-deep: rgba(13, 21, 36, 0.6);
    --msl-glass: rgba(255, 255, 255, 0.07);
    --msl-glass-hover: rgba(255, 255, 255, 0.12);
    --msl-text: rgba(255, 255, 255, 0.94);
    --msl-text-soft: rgba(255, 255, 255, 0.68);
    --msl-text-faint: rgba(255, 255, 255, 0.46);
    --msl-blue: #3b82f6;
    --msl-blue-soft: #93c5fd;
    --msl-cyan: #7dd3fc;
    --msl-green: #4ade80;
    --msl-violet: #a78bfa;
    --msl-rose: #fb7185;
    --msl-pink: #db2777;
}

/* ---------------- Hero ---------------- */

/* No overflow:hidden here: the dropdown menus in the toolbar open past the
   hero's bottom edge and must stay visible and clickable. */
.msl-hero {
    background: #0a0f18;
    margin-top: calc(-1 * var(--falix-nav-height));
    min-height: clamp(540px, 64vh, 700px);
    padding: calc(var(--falix-nav-height) + 84px) 0 64px;
    position: relative;
    display: flex;
    align-items: center;
}

.msl-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 15, 24, 0.88) 0%, rgba(10, 15, 24, 0.66) 50%, rgba(10, 15, 24, 0.42) 100%),
        linear-gradient(180deg, rgba(10, 15, 24, 0.1) 0%, rgba(17, 25, 40, 0.98) 100%);
    z-index: 1;
}

.msl-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.msl-hero .container {
    position: relative;
    z-index: 2;
}

.msl-title {
    color: #fff;
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    line-height: 1.08;
    font-weight: 700;
    margin: 0 0 14px;
    max-width: 760px;
}

.msl-description {
    max-width: 620px;
    color: var(--msl-text-soft);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 22px;
}

/* Search + filters inside the hero */
.msl-toolbar {
    display: grid;
    gap: 10px;
}

.msl-toolbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border-radius: 18px;
    background: var(--msl-glass);
    backdrop-filter: blur(10px);
    padding: 8px;
}

.msl-search-field {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    border-radius: 12px;
    padding: 0 15px;
    background: transparent;
    color: var(--msl-text-faint);
    transition: background 0.15s ease;
    margin: 0;
}

.msl-search-field:focus-within {
    background: rgba(255, 255, 255, 0.09);
}

.msl-search-field i {
    color: var(--msl-blue-soft);
}

.msl-search-field input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
}

.msl-search-field input::placeholder {
    color: var(--msl-text-faint);
}

/* Filters toggle + inline panel. The panel expands in normal page flow
   (no floating menus), so it is always solid, on top, and clickable. */
.msl-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    background: #111c30;
    color: var(--msl-text);
    min-height: 46px;
    padding: 0 18px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.msl-filters-toggle:hover,
.msl-filters-toggle.is-open {
    background: #1a2942;
}

.msl-filters-toggle i {
    color: var(--msl-blue-soft);
    font-size: 0.84rem;
}

.msl-filters-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    padding: 0 6px;
    background: var(--msl-blue);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
}

/* Smooth expand/collapse: the wrapper animates grid-template-rows from
   0fr to 1fr, so the panel slides open at its natural height with no
   JS measuring. The inner content fades in slightly after. */
.msl-filter-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.msl-filter-wrap.is-open {
    grid-template-rows: 1fr;
}

.msl-filter-clip {
    overflow: hidden;
    min-height: 0;
    visibility: hidden;
    transition: visibility 0s linear 0.34s;
}

.msl-filter-wrap.is-open .msl-filter-clip {
    visibility: visible;
    transition: visibility 0s;
}

.msl-filter-panel {
    display: grid;
    gap: 18px;
    border-radius: 18px;
    background: #131e33;
    padding: 22px 24px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.26s ease, transform 0.26s ease;
}

.msl-filter-wrap.is-open .msl-filter-panel {
    opacity: 1;
    transform: none;
    transition-delay: 0.07s;
}

/* Each group is one aligned row: fixed label column, options beside it */
.msl-filter-group {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.msl-filter-label {
    color: var(--msl-text-faint);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.15s ease;
}

.msl-filter-group.is-filtered .msl-filter-label {
    color: var(--msl-blue-soft);
}

/* Segmented control for small option sets */
.msl-seg {
    display: inline-flex;
    gap: 4px;
    border-radius: 12px;
    background: #0d1628;
    padding: 4px;
    justify-self: start;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.msl-seg-btn {
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--msl-text-soft);
    min-height: 36px;
    padding: 0 15px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.msl-seg-btn:hover {
    color: #fff;
}

.msl-seg-btn.is-active {
    background: var(--msl-blue);
    color: #fff;
}

.msl-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Compact dropdown for long option sets (versions) */
.msl-filter-select {
    appearance: none;
    -webkit-appearance: none;
    justify-self: start;
    width: min(220px, 100%);
    border: 0;
    border-radius: 12px;
    background: #0d1628 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='rgba(255,255,255,0.55)' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: var(--msl-text-soft);
    color-scheme: dark;
    min-height: 44px;
    padding: 0 38px 0 15px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
}

.msl-filter-select:hover {
    color: #fff;
}

.msl-filter-group.is-filtered .msl-filter-select {
    color: #fff;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.45);
}

.msl-filter-select:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.6);
    outline-offset: 2px;
}

.msl-filter-foot {
    display: flex;
    justify-content: flex-end;
}

.msl-filter-foot .msl-btn-ghost {
    min-height: 38px;
    padding: 0 16px;
    font-size: 0.88rem;
}

/* Applied filters: removable pills, visible even with the panel closed */
.msl-applied-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.msl-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: var(--msl-blue-soft);
    min-height: 32px;
    padding: 0 13px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.msl-pill i {
    font-size: 0.72rem;
    opacity: 0.8;
}

.msl-pill:hover,
.msl-pill:focus {
    background: rgba(251, 113, 133, 0.18);
    color: var(--msl-rose);
}

/* Tag chips: drag-to-scroll row with faded edges */
.msl-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.msl-filter-row.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.msl-filter-row::-webkit-scrollbar {
    display: none;
}

.msl-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--msl-glass);
    backdrop-filter: blur(8px);
    color: var(--msl-text-soft);
    min-height: 34px;
    padding: 0 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.msl-chip i {
    font-size: 0.74rem;
    color: var(--msl-blue-soft);
    transition: color 0.15s ease;
}

.msl-chip.is-active i {
    color: #fff;
}

.msl-filter-row.is-dragging .msl-chip {
    cursor: grabbing;
}

.msl-chip:hover {
    background: var(--msl-glass-hover);
    color: #fff;
}

.msl-chip.is-active {
    background: var(--msl-blue);
    color: #fff;
}

/* ---------------- Directory ---------------- */

.msl-directory-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.msl-directory-head .section-heading {
    margin-bottom: 0;
}

/* Quick sort sits where the result count used to, for one-tap reordering
   without opening the full filter panel. */
.msl-quick-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.msl-quick-sort label {
    color: var(--msl-text-faint);
    font-size: 0.9rem;
}

.msl-quick-sort-select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 10px;
    background: #1e293b url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--msl-text-soft);
    color-scheme: dark;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    min-height: 36px;
    padding: 0 34px 0 14px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.msl-quick-sort-select:hover {
    color: #fff;
}

.msl-quick-sort-select:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.6);
    outline-offset: 2px;
}

.msl-directory-list {
    display: grid;
    /* Two servers per row on large screens (steps down to 1 below). */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* Allow a little extra width on large displays, but keep cards big and few
   per row rather than packing many narrow ones. */
@media (min-width: 1400px) {
    #server-directory.container {
        max-width: min(92vw, 1440px);
    }
}

/* ---------------- Server card ---------------- */

.msl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: var(--msl-surface);
    overflow: hidden;
    transition: background 0.18s ease;
}

.msl-card:hover,
.msl-card:focus-within {
    background: var(--msl-surface-hover);
}

.msl-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 11px;
    padding: 16px 18px 18px;
}

.msl-card-top {
    display: flex;
    align-items: center;
    gap: 13px;
}

/* Icon sits on a flat tile so it reads as an avatar, not a floating PNG */
.msl-server-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #0d1524;
}


.msl-server-icon img {
    width: 42px;
    height: 42px;
    image-rendering: pixelated;
}

.msl-card-id {
    min-width: 0;
    flex: 1 1 auto;
}

.msl-card-id h3 {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.msl-card-id h3 a {
    color: var(--msl-text);
    text-decoration: none;
}

/* Whole card is clickable via the title link */
.msl-card-id h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.msl-card-host {
    display: block;
    color: var(--msl-blue-soft);
    font-size: 0.82rem;
    margin-top: 1px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Presence: explicit player count or Offline */
.msl-presence {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 11px;
    background: rgba(74, 222, 128, 0.14);
    color: var(--msl-green);
    font-size: 0.82rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.msl-presence::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--msl-green);
}

.msl-presence.is-offline {
    background: rgba(148, 163, 184, 0.12);
    color: var(--msl-text-faint);
}

.msl-presence.is-offline::before {
    background: rgba(148, 163, 184, 0.5);
}

.msl-card-desc {
    color: var(--msl-text-soft);
    font-size: 0.91rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.msl-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.msl-tag-list span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 11px;
    color: var(--msl-blue-soft);
    background: rgba(59, 130, 246, 0.14);
    font-size: 0.78rem;
    font-weight: 500;
}

.msl-tag-list span i {
    font-size: 0.68rem;
    opacity: 0.85;
}

/* One unified, rounded footer pinned to the card bottom: meta facts on the
   left, vote + copy actions on the right, sharing a single recessed panel. */
.msl-card-footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 11px 13px;
    border-radius: 14px;
    background: var(--msl-surface-deep);
}

.msl-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.msl-card-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 7px;
    background: var(--msl-glass);
    color: var(--msl-text-soft);
    padding: 3px 9px;
    font-size: 0.76rem;
    line-height: 1.45;
    white-space: nowrap;
}

/* Country flag shown beside a server location. */
.msl-flag {
    display: inline-block;
    flex: 0 0 auto;
    width: 16px;
    height: 11px;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: middle;
}

.msl-server-facts dd {
    flex: 1 1 auto;
    min-width: 0;
}

.msl-server-facts .msl-flag {
    width: 20px;
    height: 14px;
    vertical-align: -3px;
    margin-right: 6px;
}

.msl-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.msl-card-votes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--msl-text-soft);
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}

.msl-card-votes i {
    color: var(--msl-rose);
    font-size: 0.8rem;
}

/* ---------------- Buttons ---------------- */

.msl-btn,
.msl-btn-ghost,
.msl-copy-btn,
.msl-vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.msl-btn {
    min-height: 46px;
    padding: 0 20px;
    color: #fff;
    background: var(--msl-blue);
}

.msl-btn:hover,
.msl-btn:focus {
    background: #2563eb;
    color: #fff;
}

.msl-btn-ghost {
    min-height: 46px;
    padding: 0 20px;
    color: var(--msl-text);
    background: rgba(148, 163, 184, 0.14);
}

.msl-btn-ghost:hover,
.msl-btn-ghost:focus {
    background: rgba(148, 163, 184, 0.24);
    color: #fff;
}

/* Card copy: soft blue, sits above the stretched link */
.msl-copy-btn {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    background: rgba(59, 130, 246, 0.16);
    color: var(--msl-blue-soft);
    min-height: 34px;
    padding: 0 13px;
    font-size: 0.82rem;
}

.msl-copy-btn:hover,
.msl-copy-btn:focus {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

.msl-copy-btn.is-copied {
    background: rgba(74, 222, 128, 0.18);
    color: var(--msl-green);
}

/* ---------------- Skeletons / empty / load more ---------------- */

.msl-skeleton-card {
    border-radius: 18px;
    background: var(--msl-surface);
    padding: 16px 18px 18px;
    display: grid;
    gap: 12px;
    overflow: hidden;
    animation: msl-fade 1.4s ease-in-out infinite;
}

.msl-skeleton-line {
    border-radius: 7px;
    height: 12px;
    background: rgba(148, 163, 184, 0.16);
}

.msl-skeleton-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.msl-skeleton-row > div {
    flex: 1 1 auto;
    display: grid;
    gap: 8px;
}

.msl-skeleton-line.is-icon {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
}

.msl-skeleton-line.is-wide { width: 100%; }
.msl-skeleton-line.is-medium { width: 65%; }
.msl-skeleton-line.is-short { width: 40%; }

@keyframes msl-fade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.msl-empty {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 12px;
    border-radius: 18px;
    background: var(--msl-surface);
    color: var(--msl-text-soft);
    text-align: center;
    padding: 52px 24px;
}

.msl-empty i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.16);
    color: var(--msl-blue-soft);
    font-size: 1.3rem;
}

.msl-empty strong {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
}

.msl-empty p {
    margin: 0;
    max-width: 380px;
    font-size: 0.94rem;
}

.msl-load-more-wrap {
    display: grid;
    justify-items: center;
    margin-top: 24px;
}

.msl-load-more {
    width: min(420px, 100%);
}

.msl-load-more[disabled] {
    opacity: 0.55;
    cursor: progress;
}

/* ---------------- CTA panel ----------------
   A flat contained panel, same surface language as the cards. The page
   background runs uninterrupted from the directory through to the footer,
   whose own top margin, brand logo, and cyan border close the page. */

.msl-cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-radius: 18px;
    padding: clamp(26px, 4vw, 44px);
    background: var(--msl-surface);
}

.msl-cta-band h2 {
    color: #fff;
    font-size: clamp(1.35rem, 2.6vw, 1.8rem);
    font-weight: 600;
    margin: 0 0 8px;
}

.msl-cta-band p {
    color: var(--msl-text-soft);
    font-size: 0.98rem;
    margin: 0;
    max-width: 540px;
}

/* Both CTA buttons share one size so neither reads as an afterthought */
.msl-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.msl-cta-actions .msl-btn,
.msl-cta-actions .msl-btn-ghost {
    min-width: 220px;
}

/* ---------------- FAQ ----------------
   Native <details> accordion, same surface language as the cards, mirrored by
   FAQPage JSON-LD in the template for search rich results. */

.msl-faq {
    margin-top: 40px;
}

.msl-faq-title {
    color: #fff;
    font-size: clamp(1.35rem, 2.6vw, 1.8rem);
    font-weight: 600;
    margin: 0 0 18px;
}

.msl-faq-grid {
    display: grid;
    gap: 12px;
}

.msl-faq-item {
    border-radius: 14px;
    background: var(--msl-surface);
    overflow: hidden;
    transition: background 0.18s ease;
}

.msl-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    color: var(--msl-text);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    list-style: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.msl-faq-q::-webkit-details-marker {
    display: none;
}

.msl-faq-q::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--msl-text-faint);
    border-bottom: 2px solid var(--msl-text-faint);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.msl-faq-item[open] .msl-faq-q::after {
    transform: rotate(-135deg);
}

.msl-faq-q:hover {
    color: #fff;
    background: var(--msl-glass);
}

.msl-faq-q:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.6);
    outline-offset: -2px;
    border-radius: 14px;
}

.msl-faq-a {
    box-sizing: border-box;
    overflow: hidden;
    padding: 0 20px 18px;
    color: var(--msl-text-soft);
    font-size: 0.95rem;
    line-height: 1.65;
    transition: height 0.28s ease;
}

.msl-faq-a p {
    margin: 0;
}

.msl-faq-a a {
    color: var(--msl-blue-soft);
    text-decoration: none;
}

.msl-faq-a a:hover {
    text-decoration: underline;
}

.msl-faq-a strong {
    color: var(--msl-text);
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .msl-faq-q::after,
    .msl-faq-a {
        transition: none;
    }
}

/* ---------------- Toast ---------------- */

.msl-toast {
    position: fixed;
    z-index: 1080;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 12px;
    background: #1b2a44;
    color: var(--msl-text);
    font-size: 0.9rem;
    padding: 11px 17px;
    box-shadow: 0 14px 40px rgba(2, 6, 23, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.msl-toast.is-visible {
    opacity: 1;
}

.msl-toast i {
    color: var(--msl-green);
}

/* ---------------- Profile page ---------------- */

.msl-profile-hero {
    background: #0a0f18;
    margin-top: calc(-1 * var(--falix-nav-height));
    padding: calc(var(--falix-nav-height) + 72px) 0 60px;
    position: relative;
    overflow: hidden;
}

.msl-profile-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 15, 24, 0.9) 0%, rgba(10, 15, 24, 0.7) 52%, rgba(10, 15, 24, 0.5) 100%),
        linear-gradient(180deg, rgba(10, 15, 24, 0.14) 0%, rgba(17, 25, 40, 0.98) 100%);
    z-index: 1;
}

.msl-profile-hero .msl-hero-bg.is-banner {
    filter: blur(18px) brightness(0.62);
    transform: scale(1.1);
}

.msl-profile-hero .container {
    position: relative;
    z-index: 2;
}

.msl-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--msl-text-soft);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.15s ease;
}

.msl-back-link:hover,
.msl-back-link:focus {
    color: #fff;
}

.msl-profile-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.42fr);
    gap: clamp(22px, 4vw, 48px);
    align-items: start;
}

.msl-profile-banner {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 24px;
}

/* Banners are stored at 1920x840; matching the ratio avoids any cropping */
.msl-profile-banner img {
    display: block;
    width: 100%;
    aspect-ratio: 1920 / 840;
    object-fit: cover;
}

.msl-profile-title-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.msl-profile-title-row .msl-server-icon {
    width: 76px;
    height: 76px;
    border-radius: 19px;
}

.msl-profile-title-row .msl-server-icon img {
    width: 52px;
    height: 52px;
}

.msl-profile-title-row .msl-title {
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    margin: 0 0 6px;
}

.msl-profile-facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: var(--msl-text-soft);
    font-size: 0.94rem;
    margin: 0 0 16px;
}

.msl-profile-facts span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.msl-profile-facts i { color: var(--msl-cyan); }
.msl-profile-facts i.fa-gamepad { color: var(--msl-violet); }
.msl-profile-facts i.fa-globe { color: var(--msl-blue-soft); }
.msl-profile-facts i.fa-heart { color: var(--msl-rose); }

.msl-profile-short {
    color: var(--msl-text-soft);
    font-size: 1.02rem;
    line-height: 1.68;
    margin: 0 0 16px;
    max-width: 640px;
    overflow-wrap: anywhere;
}

/* Join panel */
.msl-join-panel {
    border-radius: 20px;
    background: var(--msl-surface);
    backdrop-filter: blur(10px);
    padding: 22px;
}

.msl-panel-label {
    display: block;
    color: var(--msl-blue-soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.msl-address-box {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    background: var(--msl-surface-deep);
    padding: 7px 7px 7px 13px;
    margin-bottom: 16px;
}

.msl-address-box code {
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    font-size: 0.94rem;
    overflow-wrap: anywhere;
}

.msl-address-box .msl-copy-btn {
    min-height: 36px;
}

.msl-players-label {
    display: flex;
    justify-content: space-between;
    color: var(--msl-text-soft);
    font-size: 0.86rem;
    margin-bottom: 7px;
    font-variant-numeric: tabular-nums;
}

.msl-players-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
    margin-bottom: 18px;
}

.msl-players-bar div {
    height: 100%;
    border-radius: 999px;
    background: var(--msl-green);
}

.msl-server-facts {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.msl-server-facts div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    border-radius: 11px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.05);
}

.msl-server-facts dt {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--msl-text-soft);
    font-size: 0.88rem;
    font-weight: 400;
    margin: 0;
}

.msl-server-facts dt i {
    width: 16px;
    text-align: center;
    color: var(--msl-blue-soft);
    font-size: 0.82rem;
}

.msl-server-facts dd {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 500;
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.msl-vote-btn {
    width: 100%;
    min-height: 46px;
    padding: 0 20px;
    color: #fff;
    background: var(--msl-pink);
}

.msl-vote-btn:hover,
.msl-vote-btn:focus {
    background: #be185d;
    color: #fff;
}

.msl-vote-btn i {
    color: #fbcfe8;
}

/* auto-fit: a lone link (website or Discord only) fills the panel width */
.msl-join-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.msl-join-freshness {
    display: block;
    margin-top: 14px;
    color: var(--msl-text-faint);
    font-size: 0.78rem;
    text-align: center;
}

/* ---------------- Brand icons ----------------
   The site-wide Font Awesome bundle ships only the solid face, so the brand
   marks used on these pages (Discord button, website links by URL type) get
   their font and glyphs here. Font loads lazily when a glyph is rendered. */

@font-face {
    font-family: "Font Awesome 6 Brands";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url(../icons/webfonts/fa-brands-400.woff2) format("woff2");
}

.fa-discord { --fa: "\f392"; }
.fa-youtube { --fa: "\f167"; }
.fa-tiktok { --fa: "\e07b"; }
.fa-x-twitter { --fa: "\e61b"; }
.fa-instagram { --fa: "\f16d"; }
.fa-facebook { --fa: "\f09a"; }
.fa-twitch { --fa: "\f1e8"; }
.fa-github { --fa: "\f09b"; }
.fa-reddit { --fa: "\f1a1"; }
.fa-telegram { --fa: "\f2c6"; }
.fa-patreon { --fa: "\f3d9"; }
.fa-bluesky { --fa: "\e671"; }
.fa-steam { --fa: "\f1b6"; }

/* Profile body */
.msl-profile-panel {
    border-radius: 20px;
    background: var(--msl-surface);
    padding: clamp(22px, 3vw, 32px);
}

.msl-profile-about p {
    color: var(--msl-text-soft);
    font-size: 0.98rem;
    line-height: 1.75;
    margin: 0 0 13px;
    overflow-wrap: anywhere;
}

.msl-profile-about p:last-child {
    margin-bottom: 0;
}

/* Gallery */
/* Screenshots tab — grid of thumbnails that open the lightbox. */
.msl-shots-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.msl-shots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.msl-shot {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: var(--msl-surface-deep);
    cursor: zoom-in;
}

.msl-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover/focus affordance: dim the shot and reveal a magnifier so it reads as
   openable. Opacity only — no movement. */
.msl-shot-zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.5);
    color: #fff;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.msl-shot:hover .msl-shot-zoom,
.msl-shot img:focus-visible + .msl-shot-zoom {
    opacity: 1;
}

.msl-shot img:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.6);
    outline-offset: -2px;
}

/* Related */
.msl-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* ---------------- Vote modal ---------------- */

.msl-modal {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.72);
}

.msl-modal.is-open {
    display: flex;
}

.msl-modal-card {
    width: min(420px, 100%);
    border-radius: 18px;
    background: #16233a;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.55);
    padding: 24px;
}

.msl-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.msl-modal-head h3 {
    color: #fff;
    font-size: 1.08rem;
    font-weight: 600;
    margin: 0;
}

.msl-modal-close {
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--msl-glass);
    color: var(--msl-text-soft);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.msl-modal-close:hover,
.msl-modal-close:focus {
    background: var(--msl-glass-hover);
    color: #fff;
}

.msl-modal-card p {
    color: var(--msl-text-soft);
    font-size: 0.93rem;
    line-height: 1.55;
    margin: 0 0 14px;
}

.msl-modal-turnstile {
    display: flex;
    justify-content: center;
    margin: 4px 0 14px;
    min-height: 65px;
}

.msl-modal-feedback {
    min-height: 20px;
    margin: 9px 0 4px;
    color: var(--msl-text-soft);
    font-size: 0.87rem;
}

.msl-modal-feedback.is-error {
    color: #fca5a5;
}

.msl-modal-feedback.is-success {
    color: #86efac;
}

.msl-modal-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 8px;
}

/* ---------------- Connect button + modal ---------------- */

.msl-connect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: var(--msl-blue);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.msl-connect-btn:hover {
    background: #2f6fe0;
}

.msl-connect-btn.is-offline {
    background: #f59e0b;
    color: #1a1205;
}

.msl-connect-btn.is-offline:hover {
    background: #e8920b;
}

.msl-modal-card.msl-connect-card {
    width: min(560px, 100%);
}

/* Offline → start banner (links to the quick-start flow) */
.msl-connect-offline {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    background: rgba(245, 158, 11, 0.12);
    padding: 13px 15px;
    margin-bottom: 16px;
    text-decoration: none;
    transition: background 0.15s ease;
}

a.msl-connect-offline:hover {
    background: rgba(245, 158, 11, 0.2);
}

.msl-connect-offline-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 1rem;
}

.msl-connect-offline-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.msl-connect-offline-text strong {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.msl-connect-offline-text span {
    color: var(--msl-text-soft);
    font-size: 0.82rem;
}

.msl-connect-offline-go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f59e0b;
    color: #1a1205;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 13px;
    border-radius: 10px;
}

.msl-connect-offline.is-static {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.msl-connect-offline.is-static .msl-connect-offline-icon {
    background: var(--msl-glass);
    color: var(--msl-text-faint);
}

/* Address hero */
.msl-connect-hero {
    border-radius: 14px;
    background: var(--msl-surface-deep);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.msl-connect-hero-label {
    display: block;
    color: var(--msl-text-faint);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 9px;
}

.msl-connect-hero-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.msl-connect-ip {
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.msl-connect-copy {
    flex: 0 0 auto;
}

/* Edition tabs (crossover) */
.msl-connect-tabs {
    display: flex;
    gap: 4px;
    background: var(--msl-surface-deep);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.msl-connect-tab {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    color: var(--msl-text-soft);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.msl-connect-tab:hover {
    color: var(--msl-text);
}

.msl-connect-tab.is-active {
    background: var(--msl-blue);
    color: #fff;
}

/* Numbered steps */
.msl-connect-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msl-connect-steps li {
    display: flex;
    gap: 12px;
    color: var(--msl-text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

.msl-connect-steps li > div {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 2px;
}

.msl-connect-steps strong {
    color: #fff;
    font-weight: 700;
}

.msl-connect-steps em {
    color: var(--msl-blue-soft);
    font-style: normal;
    font-weight: 600;
}

.msl-step-num {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--msl-blue);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Bedrock address + port fields */
.msl-connect-fields {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.msl-connect-field {
    flex: 1 1 0;
    min-width: 0;
}

.msl-connect-field-label {
    display: block;
    color: var(--msl-text-faint);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.msl-connect-field-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 9px;
    padding: 5px 6px 5px 10px;
}

.msl-connect-field-row code {
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ---------------- Lightbox ---------------- */

[data-lightbox] {
    cursor: zoom-in;
}

.msl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(2, 6, 23, 0.92);
}

.msl-lightbox.is-open {
    display: flex;
}

.msl-lightbox img {
    max-width: min(1280px, 94vw);
    max-height: 84vh;
    border-radius: 10px;
    cursor: default;
}

.msl-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 0;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    background: rgba(30, 41, 59, 0.85);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.msl-lightbox-close:hover,
.msl-lightbox-close:focus {
    background: rgba(51, 65, 85, 0.95);
}

.msl-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    width: 46px;
    height: 46px;
    background: rgba(30, 41, 59, 0.85);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.msl-lightbox-nav:hover,
.msl-lightbox-nav:focus {
    background: rgba(51, 65, 85, 0.95);
}

.msl-lightbox-nav.is-prev {
    left: 18px;
}

.msl-lightbox-nav.is-next {
    right: 18px;
}

.msl-lightbox-count {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--msl-text-soft);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

/* ---------------- Focus, motion, responsive ---------------- */

.msl-btn:focus-visible,
.msl-btn-ghost:focus-visible,
.msl-chip:focus-visible,
.msl-copy-btn:focus-visible,
.msl-vote-btn:focus-visible,
.msl-filters-toggle:focus-visible,
.msl-modal-close:focus-visible,
.msl-lightbox-close:focus-visible,
.msl-lightbox-nav:focus-visible,
.msl-back-link:focus-visible,
.msl-card-id h3 a:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.6);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .msl-skeleton-card {
        animation: none;
    }

    .msl-filter-wrap,
    .msl-filter-clip,
    .msl-filter-panel {
        transition: none;
    }
}

@media (max-width: 991.98px) {
    .msl-hero {
        min-height: auto;
        padding: calc(var(--falix-nav-height) + 68px) 0 52px;
    }

    .msl-directory-list,
    .msl-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msl-profile-hero-grid {
        grid-template-columns: 1fr;
    }

    .msl-join-panel {
        max-width: 640px;
    }
}

@media (max-width: 767.98px) {
    .msl-hero::before {
        background:
            linear-gradient(180deg, rgba(10, 15, 24, 0.84) 0%, rgba(10, 15, 24, 0.9) 58%, #111928 100%);
    }

    .msl-profile-hero {
        padding: calc(var(--falix-nav-height) + 52px) 0 44px;
    }

    .msl-directory-list,
    .msl-related-grid {
        grid-template-columns: 1fr;
    }

    .msl-filters-toggle span:not(.msl-filters-badge) {
        display: none;
    }

    .msl-directory-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .msl-filter-group {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: start;
    }

    .msl-cta-band {
        flex-direction: column;
        align-items: stretch;
    }

    .msl-cta-actions .msl-btn,
    .msl-cta-actions .msl-btn-ghost {
        flex: 1 1 auto;
    }

    .msl-join-links,
    .msl-modal-actions {
        grid-template-columns: 1fr;
    }
}

/* ---------------- Profile tabs (segmented, full-width) ---------------- */

/* Segmented selector — mirrors the status page's .time-range-selector:
   a translucent rail with a soft white "active" pill rather than a solid fill. */
.msl-tab-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    padding: 0.5rem;
    border-radius: 12px;
    margin-bottom: 26px;
    overflow-x: auto;
    scrollbar-width: none;
}

.msl-tab-nav::-webkit-scrollbar {
    display: none;
}

.msl-tab {
    appearance: none;
    border: none;
    flex: 1 1 0;
    min-width: max-content;
    justify-content: center;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: all 0.2s ease;
}

.msl-tab i {
    font-size: 0.9em;
    color: var(--msl-text-faint);
    transition: color 0.2s ease;
}

.msl-tab:hover {
    color: #fff;
}

.msl-tab:hover i {
    color: var(--msl-text-soft);
}

.msl-tab.is-active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.msl-tab.is-active i {
    color: #fff;
}

.msl-tab-panel {
    animation: msl-fade-in 0.25s ease;
}

.msl-tab-panel:focus-visible {
    outline: none;
}

.msl-panel-heading {
    margin-top: 0;
}

@keyframes msl-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ---------------- Player activity (stats) ---------------- */

.msl-stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.msl-stats-head-text {
    min-width: 0;
}

.msl-stats-head .section-heading {
    margin: 0 0 3px;
}

.msl-stats-sub {
    color: var(--msl-text-faint);
    font-size: 0.9rem;
    margin: 0;
}

.msl-range-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 10px;
}

.msl-range-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 6px 15px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.msl-range-btn:hover {
    color: #fff;
}

.msl-range-btn.is-active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.msl-stat-callouts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.msl-stat-callout {
    background: var(--msl-glass);
    border-radius: 14px;
    padding: 15px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msl-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--msl-text-faint);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.msl-stat-label::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--msl-text-faint);
}

/* Now = green, Peak = blue, Average = violet. */
.msl-stat-callout:nth-child(1) .msl-stat-label::before {
    background: var(--msl-green);
}

.msl-stat-callout:nth-child(2) .msl-stat-label::before {
    background: var(--msl-blue);
}

.msl-stat-callout:nth-child(3) .msl-stat-label::before {
    background: var(--msl-violet);
}

.msl-stat-value {
    color: var(--msl-text);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.msl-chart-wrap {
    position: relative;
    height: 240px;
}

.msl-chart-wrap canvas {
    width: 100% !important;
}

.msl-chart-empty {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--msl-text-faint);
    font-size: 0.92rem;
    padding: 0 24px;
}

.msl-stats-note {
    color: var(--msl-text-faint);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 14px 0 0;
}

/* Reset-zoom button (appears after the user zooms/pans the chart) */
.msl-chart-reset {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--msl-glass);
    border: none;
    color: var(--msl-text-soft);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 5;
    transition: background 0.15s ease, color 0.15s ease;
}

.msl-chart-reset:hover {
    background: var(--msl-glass-hover);
    color: #fff;
}

/* Custom chart tooltip */
.msl-chart-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    background: #1e293b;
    border-radius: 10px;
    padding: 8px 11px;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.5);
    opacity: 0;
    transform: translate(-50%, calc(-100% - 12px));
    transition: opacity 0.12s ease;
    z-index: 6;
    white-space: nowrap;
}

.msl-chart-tooltip.is-active {
    opacity: 1;
}

.msl-tt-title {
    color: var(--msl-text-faint);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.msl-tt-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.msl-tt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--msl-blue);
    align-self: center;
}

.msl-tt-value {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.msl-tt-label {
    color: var(--msl-text-soft);
    font-size: 0.78rem;
}

/* ---------------- Online players (skin heads) ---------------- */

.msl-online-players {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.msl-online-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.msl-online-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--msl-text);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.msl-online-dot {
    font-size: 0.55rem;
    color: var(--msl-green);
}

.msl-online-count {
    display: inline-flex;
    align-items: center;
    color: var(--msl-text-soft);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--msl-glass);
    white-space: nowrap;
}

.msl-head-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 14px 10px;
}

.msl-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.msl-head img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--msl-surface-deep);
    image-rendering: pixelated;
}

.msl-head span {
    max-width: 100%;
    font-size: 0.72rem;
    color: var(--msl-text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- Share this server ---------------- */

.msl-share-intro {
    color: var(--msl-text-soft);
    font-size: 0.98rem;
    line-height: 1.6;
    margin: 0 0 18px;
}

.msl-share-preview {
    background: var(--msl-surface-deep);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
    text-align: center;
}

.msl-share-preview img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.msl-share-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 10px;
    margin-bottom: 12px;
}

.msl-share-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 15px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.msl-share-tab:hover {
    color: #fff;
}

.msl-share-tab.is-active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.msl-share-code-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    background: var(--msl-surface-deep);
    border-radius: 12px;
    padding: 12px 14px;
}

.msl-share-code {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--msl-text);
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.msl-share-code-row .msl-copy-btn {
    flex: 0 0 auto;
    align-self: center;
}

@media (max-width: 768px) {
    .msl-stat-value {
        font-size: 1.3rem;
    }
}

/* ===================================================================
   Profile tabs: count badges, Updates feed, Comments
   =================================================================== */
.msl-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--msl-glass);
    color: var(--msl-text-soft);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.msl-tab.is-active .msl-tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Hide the count pill entirely when there is nothing to count (e.g. 0 comments). */
.msl-tab-count:empty {
    display: none;
}

/* ---- Updates feed ---- */
.msl-update-feed {
    display: grid;
    gap: 18px;
}

.msl-update-card {
    border-radius: 14px;
    background: var(--msl-surface);
    border: 1px solid var(--msl-glass);
    overflow: hidden;
}

.msl-update-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px 10px;
    border-bottom: 1px solid var(--msl-glass);
}

.msl-update-title {
    margin: 0;
    color: var(--msl-text);
    font-size: 1.08rem;
    font-weight: 600;
}

.msl-update-date {
    color: var(--msl-text-faint);
    font-size: 0.82rem;
    white-space: nowrap;
}

.msl-update-body {
    padding: 14px 20px 18px;
    color: var(--msl-text-soft);
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.msl-update-body p { margin: 0 0 0.75em; }
.msl-update-body p:last-child { margin-bottom: 0; }
.msl-update-body h2,
.msl-update-body h3,
.msl-update-body h4 { color: var(--msl-text); font-weight: 600; margin: 1em 0 0.4em; }
.msl-update-body ul,
.msl-update-body ol { padding-left: 1.5em; margin: 0.5em 0; }
.msl-update-body li { margin-bottom: 0.25em; }
.msl-update-body a { color: var(--msl-blue-soft); text-decoration: underline; }
.msl-update-body blockquote {
    margin: 0.75em 0;
    padding: 0.4em 1em;
    border-left: 3px solid var(--msl-blue);
    color: var(--msl-text-faint);
}
.msl-update-body pre {
    background: var(--msl-surface-deep);
    padding: 12px 14px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.85rem;
}
.msl-update-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- Comments ---- */
.msl-comment-list {
    display: grid;
    gap: 12px;
}

.msl-comment-loading {
    color: var(--msl-text-faint);
    font-size: 0.92rem;
    padding: 18px;
    text-align: center;
}

.msl-comment-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 18px;
    text-align: center;
    color: var(--msl-text-faint);
    font-size: 0.92rem;
}

.msl-comment-empty p {
    margin: 0;
}

.msl-comment {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--msl-surface);
    border: 1px solid var(--msl-glass);
}

.msl-comment-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--msl-blue), var(--msl-cyan));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

/* Footer row of the compose form: captcha on the left, submit on the right. */
.msl-comment-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.msl-comment-main {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.msl-comment-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.msl-comment-author {
    color: var(--msl-text);
    font-size: 0.95rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.msl-comment-time {
    color: var(--msl-text-faint);
    font-size: 0.78rem;
}

.msl-comment-body {
    margin: 6px 0 0;
    color: var(--msl-text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.msl-comment-flag {
    position: absolute;
    top: 0;
    right: 0;
    appearance: none;
    border: none;
    background: transparent;
    color: var(--msl-text-faint);
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
    font-size: 0.82rem;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.msl-comment-flag:hover { opacity: 1; color: var(--msl-rose); }
.msl-comment-flag.is-reported { color: var(--msl-rose); opacity: 1; cursor: default; }

.msl-comment-more {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

/* Header row above the thread: heading on the left, compose toggle on the right. */
.msl-comment-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.msl-comment-bar .msl-panel-heading {
    margin: 0;
}

/* Toggle + empty-state button reuse .msl-btn-ghost; just sized a touch smaller. */
.msl-comment-toggle,
.msl-comment-empty-cta {
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.88rem;
}

/* Compose box — simply revealed by the toggle; no extra chrome. */
.msl-comment-form-wrap {
    margin: 0 0 20px;
}

.msl-comment-form-note {
    margin: 0 0 12px;
    color: var(--msl-text-faint);
    font-size: 0.82rem;
}

.msl-comment-input,
.msl-comment-textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--msl-glass);
    background: var(--msl-surface-deep);
    color: var(--msl-text);
    font-size: 0.92rem;
    font-family: inherit;
}

.msl-comment-input:focus,
.msl-comment-textarea:focus {
    outline: none;
    border-color: var(--msl-blue);
}

.msl-comment-textarea { resize: vertical; min-height: 90px; }

.msl-comment-turnstile { margin: 0; }

.msl-comment-feedback {
    font-size: 0.85rem;
    margin: 8px 0 0;
    min-height: 1em;
    color: var(--msl-text-soft);
}

.msl-comment-feedback:empty {
    margin: 0;
    min-height: 0;
}

.msl-comment-feedback.is-error { color: var(--msl-rose); }
.msl-comment-feedback.is-success { color: var(--msl-green); }
