.server-detail-page {
    display: grid;
    gap: 20px;
}

.server-detail-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 4vw, 42px);
    background:
        linear-gradient(90deg, rgba(8, 11, 12, .98), rgba(8, 11, 12, .72)),
        url('/images/treegaming-7dtd-badge.webp') 93% 43% / 470px auto no-repeat;
}

.server-detail-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 201, 92, .08);
    pointer-events: none;
}

.server-detail-heading {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.server-detail-title-wrap { min-width: 0; }

.server-detail-title {
    margin: 12px 0 10px;
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    overflow-wrap: anywhere;
    text-shadow: 0 4px 24px rgba(0, 0, 0, .72);
}

.server-detail-address {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--gold-bright);
    background: rgba(7, 9, 10, .72);
    font: 750 .88rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-decoration: none;
}

.server-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.server-action-button,
.server-copy-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--gold-bright);
    background: rgba(10, 13, 14, .82);
    font: 850 .74rem/1 "Segoe UI", Arial, sans-serif;
    letter-spacing: .065em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.server-action-button:hover,
.server-copy-button:hover {
    transform: translateY(-1px);
    border-color: var(--gold);
    background: rgba(213, 168, 74, .12);
}

.server-action-button.primary {
    border-color: var(--gold-bright);
    color: #0d0d0c;
    background: linear-gradient(180deg, #ffd265, #dba62f);
}

.server-live-strip {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-top: 28px;
}

.server-live-stat {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    background: rgba(8, 11, 12, .78);
    backdrop-filter: blur(8px);
}

.server-live-stat > span {
    display: block;
    color: var(--gold);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.server-live-stat strong {
    display: block;
    margin-top: 7px;
    color: var(--text);
    font-size: .98rem;
    overflow-wrap: anywhere;
}

.server-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid rgba(202, 83, 69, .34);
    border-radius: 2px;
    color: #eb877a;
    background: rgba(163, 59, 49, .12);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.server-status-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.server-status-pill.online {
    border-color: rgba(110, 209, 132, .34);
    color: var(--green);
    background: rgba(110, 209, 132, .1);
}

.server-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    gap: 20px;
    align-items: start;
}

.server-detail-column {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.server-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.server-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(213, 168, 74, .035);
}

.server-panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.18rem;
    letter-spacing: -.01em;
}

.server-panel-body { padding: 20px; }

.server-overview-grid,
.server-settings-grid { display: grid; gap: 0; }

.server-detail-row {
    display: grid;
    grid-template-columns: minmax(150px, 38%) minmax(0, 1fr);
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.server-detail-row:last-child { border-bottom: 0; }

.server-detail-key {
    color: var(--muted);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.server-detail-value {
    color: var(--text-soft);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.server-banner-preview-wrap {
    display: block;
    padding: 9px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #080b0e;
}

.server-banner-preview {
    display: block;
    width: 560px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 2px;
}

.server-embed-tools {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}

.server-embed-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.server-embed-row label {
    color: var(--gold);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.server-embed-row input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 2px;
    color: var(--text-soft);
    background: #0b0f11;
    font: .76rem ui-monospace, SFMono-Regular, Consolas, monospace;
}

.server-copy-button { min-height: 42px; padding: 9px 12px; }

.server-embed-note,
.server-panel-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.58;
}

.server-history-list {
    display: grid;
    gap: 7px;
    max-height: 420px;
    overflow-y: auto;
}

.server-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 2px;
    background: rgba(255, 255, 255, .025);
}

.server-history-row strong { color: var(--text-soft); }
.server-history-row span { color: var(--muted); font-size: .82rem; }

.server-description {
    color: var(--text-soft);
    line-height: 1.68;
    overflow-wrap: anywhere;
}

.server-description p { margin: 0 0 12px; color: var(--text-soft); }
.server-description p:last-child { margin-bottom: 0; }

.server-loading,
.server-error {
    padding: 17px;
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
}

.server-error {
    border-color: rgba(202, 83, 69, .34);
    color: #ee9a8f;
    background: rgba(163, 59, 49, .1);
}

.server-raw-details summary {
    cursor: pointer;
    color: var(--gold-bright);
    font-weight: 800;
}

.server-raw-details pre {
    max-height: 440px;
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    color: #d7ded7;
    background: #070a0b;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .75rem;
}

@media (max-width: 1050px) {
    .server-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .server-detail-hero {
        background-position: 125% 45%;
        background-size: 360px auto;
    }

    .server-detail-heading { display: grid; }
    .server-detail-actions { justify-content: stretch; }
    .server-action-button { flex: 1 1 calc(50% - 6px); }
    .server-live-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .server-embed-row { grid-template-columns: 1fr; }
    .server-copy-button { width: 100%; }
}

@media (max-width: 520px) {
    .server-detail-row { grid-template-columns: 1fr; gap: 5px; }
    .server-live-strip { grid-template-columns: 1fr 1fr; }
    .server-panel-header,
    .server-panel-body { padding-right: 15px; padding-left: 15px; }
    .server-detail-actions { display: grid; grid-template-columns: 1fr; }
    .server-action-button { width: 100%; }
}
