:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #edf7f5;
    --text: #172033;
    --muted: #627084;
    --line: #dce3ed;
    --accent: #0f8f7b;
    --accent-dark: #096b62;
    --warning: #b95035;
    --shadow: 0 18px 45px rgba(33, 47, 69, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.language-picker {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

.language-picker select {
    min-height: 40px;
    max-width: 180px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    padding: 0 12px;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.primary-content {
    min-width: 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.1rem, 6.3vw, 4.7rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.lead {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.server-ip,
.status-bar,
.ip-card,
.ad-slot {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.server-ip {
    min-width: 0;
    padding: 18px;
    border-radius: 8px;
}

.server-ip span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
}

.server-ip strong {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
    font-size: 1.1rem;
}

.status-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

.pulse {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(15, 143, 123, 0.12);
}

.ad-slot {
    display: grid;
    place-items: center;
    min-width: 0;
    border-radius: 8px;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(98, 112, 132, 0.06),
            rgba(98, 112, 132, 0.06) 8px,
            rgba(98, 112, 132, 0.1) 8px,
            rgba(98, 112, 132, 0.1) 16px
        ),
        var(--surface);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ad-slot-banner {
    min-height: 96px;
    margin-bottom: 18px;
}

.results + .ad-slot-banner {
    margin-top: 18px;
}

.ad-rail {
    position: sticky;
    top: 24px;
}

.ad-slot-side {
    min-height: 600px;
}

.results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ip-card {
    min-width: 0;
    border-radius: 8px;
    padding: 22px;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--accent-dark);
    font-weight: 800;
}

.card-state {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.ip-card[data-state="error"] .card-state {
    color: var(--warning);
}

.ip-card[data-state="error"] .details {
    display: none;
}

.ip-address {
    display: block;
    min-height: 42px;
    margin-bottom: 20px;
    overflow-wrap: anywhere;
    font-size: 1.55rem;
    line-height: 1.25;
}

.details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.details div {
    display: grid;
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

dt,
dd {
    margin: 0;
}

dt {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

dd {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 750;
}

.note {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 1040px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .ad-rail {
        display: none;
    }
}

@media (max-width: 780px) {
    .page {
        width: min(100% - 24px, 560px);
        padding: 28px 0;
    }

    .toolbar {
        justify-content: flex-start;
        margin-bottom: 20px;
    }

    .hero,
    .results {
        grid-template-columns: 1fr;
    }

    .hero {
        align-items: stretch;
    }

    .ad-slot-banner {
        min-height: 90px;
    }

    h1 {
        font-size: clamp(2rem, 13.5vw, 3.6rem);
    }
}

@media (max-width: 440px) {
    .details div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .card-state {
        text-align: left;
    }
}
