* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #e5e7eb;
    background: radial-gradient(circle at top, #1b2234 0%, #0f1422 55%, #0a0f1a 100%);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.servers-page {
    max-width: 1040px;
    margin: 48px auto;
    padding: 0 20px;
}

.servers-page__header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 2.6vw, 2.6rem);
    color: #f8fafc;
}

.servers-page__header p {
    margin: 10px 0 0;
    color: #94a3b8;
}

.servers-card {
    margin-top: 24px;
    border: 1px solid #243049;
    border-radius: 14px;
    background: rgba(14, 20, 33, 0.86);
    overflow: hidden;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
}

.servers-table th,
.servers-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #243049;
    text-align: left;
    vertical-align: middle;
}

.servers-table thead th {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93a7cc;
    background: rgba(25, 35, 55, 0.55);
}

.servers-table tbody tr:hover {
    background: rgba(34, 47, 74, 0.4);
}

.servers-table tbody tr.server-row--dev {
    background: rgba(44, 33, 74, 0.24);
    opacity: 0.72;
}

.servers-table tbody tr.server-row--dev:hover {
    background: rgba(57, 42, 97, 0.34);
}

.servers-table tbody tr:last-child td {
    border-bottom: none;
}

.server-name {
    font-weight: 600;
    color: #f8fafc;
}

.status-badge {
    display: inline-block;
    min-width: 88px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.status-badge--online {
    color: #86efac;
    background: rgba(22, 101, 52, 0.35);
    border: 1px solid rgba(134, 239, 172, 0.25);
}

.status-badge--maintenance {
    color: #fcd34d;
    background: rgba(133, 77, 14, 0.35);
    border: 1px solid rgba(252, 211, 77, 0.3);
}

.status-badge--dev {
    color: #c4b5fd;
    background: rgba(91, 33, 182, 0.28);
    border: 1px solid rgba(196, 181, 253, 0.32);
}

.motd-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
}

.motd-link:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
    color: #bfdbfe;
}

.empty-state {
    text-align: center;
    color: #94a3b8;
}

.home-links {
    display: flex;
    gap: 18px;
    padding: 22px;
    align-items: center;
}

@media (max-width: 840px) {
    .servers-table th,
    .servers-table td {
        padding: 12px;
        font-size: 0.9rem;
    }
}

.portal-home {
    min-height: 100vh;
}

.portal-shell {
    width: min(1140px, 92%);
    margin: 0 auto;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(58, 78, 114, 0.45);
    background: rgba(10, 15, 26, 0.78);
}

.portal-header__inner {
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.portal-logo {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-self: center;
}

.portal-nav__link {
    color: #9db0d2;
    text-decoration: none;
    font-weight: 600;
}

.portal-nav__link:hover,
.portal-nav__link.is-active {
    color: #f8fafc;
}

.portal-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.portal-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c7dbff;
    text-decoration: none;
    font-weight: 700;
}

.portal-cart-menu {
    position: relative;
}

.portal-cart-menu > summary {
    list-style: none;
    cursor: pointer;
}

.portal-cart-menu > summary::-webkit-details-marker {
    display: none;
}

.portal-cart__count {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: #0b1220;
    background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

.portal-cart:hover {
    color: #f8fafc;
}

.portal-cart-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(340px, 86vw);
    border: 1px solid #2a3b59;
    border-radius: 12px;
    background: #101a2a;
    padding: 12px;
    z-index: 45;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.portal-cart-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.portal-cart-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #dbeafe;
    border-bottom: 1px solid #1f2c45;
    padding-bottom: 6px;
}

.portal-cart-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-cart-item-actions .motd-link {
    font-size: 0.82rem;
}

.portal-cart-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.portal-cart-total {
    margin: 10px 0;
    color: #9fb1d3;
}

.portal-cart-group {
    margin-bottom: 10px;
}

.portal-cart-group:last-of-type {
    margin-bottom: 0;
}

.portal-cart-group__title {
    margin: 0 0 6px;
    color: #93a7cc;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-cart-empty {
    margin: 0 0 10px;
    color: #9fb1d3;
}

.portal-user-menu {
    position: relative;
}

.portal-user-menu > summary {
    list-style: none;
    cursor: pointer;
}

.portal-user-menu > summary::-webkit-details-marker {
    display: none;
}

.portal-user-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #2a3b59;
}

.portal-user-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #dbeafe;
    background: rgba(42, 59, 89, 0.8);
}

.portal-user-name {
    color: #dbeafe;
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, 84vw);
    border: 1px solid #2a3b59;
    border-radius: 12px;
    background: #101a2a;
    padding: 12px;
    z-index: 45;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 10px;
}

.portal-user-id {
    margin: 0;
    color: #9fb1d3;
    font-size: 0.82rem;
}

.portal-user-points {
    margin: 0;
    color: #dbeafe;
    font-weight: 700;
}

.portal-online {
    color: #b5c6e8;
    font-size: 0.9rem;
}

.portal-section {
    padding: 56px 0;
}

.portal-hero {
    padding-top: 44px;
}

.portal-hero__grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.hero-card,
.project-list,
.panel,
.team-card,
.stat-card {
    border: 1px solid #243049;
    border-radius: 14px;
    background: rgba(14, 20, 33, 0.86);
}

.hero-card {
    padding: 28px;
}

.hero-card__kicker {
    margin: 0;
    color: #93a7cc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.hero-card h1 {
    margin: 10px 0 14px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    color: #f8fafc;
}

.hero-card p {
    margin: 0;
    color: #a9bbdc;
    max-width: 62ch;
}

.hero-card__actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.project-list {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.project-list__item {
    padding: 14px;
    border-radius: 10px;
    background: rgba(29, 41, 63, 0.48);
    border: 1px solid #2e3c5c;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.project-list__item h2 {
    margin: 6px 0 0;
    color: #f8fafc;
    font-size: 1.05rem;
}

.project-list__game,
.project-list__players {
    margin: 0;
    color: #99add2;
    font-size: 0.86rem;
}

.split {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.split h2,
.portal-shell > h2 {
    margin: 0 0 10px;
    color: #f8fafc;
}

.muted {
    margin: 0;
    color: #9fb1d3;
    line-height: 1.7;
}

.panel {
    padding: 24px;
}

.panel--accent {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    border-color: rgba(96, 165, 250, 0.45);
}

.cta-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
}

.portal-btn--primary {
    color: #0b1220;
    background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

.portal-btn--primary:hover {
    filter: brightness(1.06);
}

.portal-btn--outline {
    color: #c7dbff;
    border-color: #345084;
    background: rgba(24, 34, 53, 0.6);
}

.portal-btn--outline:hover {
    background: rgba(39, 56, 86, 0.62);
}

.team-grid,
.stats-grid {
    display: grid;
    gap: 14px;
}

.team-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.team-card {
    text-decoration: none;
    padding: 18px;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-card__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #2a3b59;
    margin-bottom: 0;
    flex: 0 0 auto;
}

.team-card__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #dbeafe;
    background: rgba(42, 59, 89, 0.8);
}

.team-card__content {
    display: grid;
    gap: 6px;
}

.team-card h3 {
    margin: 0;
    font-size: 1rem;
}

.team-card p {
    margin: 0;
    color: #9fb1d3;
    font-size: 0.9rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
    padding: 20px;
    text-align: center;
}

.stat-card__value {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    color: #f8fafc;
}

.stat-card__label {
    margin: 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    color: #9fb1d3;
}

.portal-footer {
    padding: 24px 0 34px;
    border-top: 1px solid rgba(58, 78, 114, 0.45);
}

.portal-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.portal-footer__inner p {
    margin: 0;
    color: #9fb1d3;
}

.portal-footer__links {
    display: flex;
    gap: 14px;
}

.portal-footer__links a {
    color: #b5c6e8;
    text-decoration: none;
}

.portal-footer__links a:hover {
    color: #f8fafc;
}

.auth-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 15, 0.72);
    display: grid;
    place-items: center;
    z-index: 40;
    padding: 20px;
}

.auth-popup {
    width: min(560px, 100%);
    border: 1px solid #2a3b59;
    border-radius: 14px;
    background: #101a2a;
    padding: 22px;
}

.auth-popup h2 {
    margin: 0 0 10px;
    color: #f8fafc;
}

.auth-popup p {
    margin: 0;
    color: #9fb1d3;
}

.auth-popup__actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shop-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #243049;
}

.shop-server-title {
    padding: 14px 16px;
    font-weight: 700;
    color: #dbeafe;
    border-bottom: 1px solid #243049;
    background: rgba(25, 35, 55, 0.55);
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 55;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
}

.shop-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #2a3b59;
    border-radius: 12px;
    background: #101a2a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.shop-toast p {
    margin: 2px 0 0;
    color: #dbeafe;
}

.shop-toast--hide {
    opacity: 0;
    transform: translateY(12px);
}

@media (max-width: 980px) {
    .portal-hero__grid,
    .split {
        grid-template-columns: 1fr;
    }

    .cta-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 780px) {
    .portal-header__inner {
        min-height: auto;
        padding: 12px 0;
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .portal-nav {
        flex-wrap: wrap;
        justify-self: start;
    }

    .portal-header__actions {
        justify-self: start;
    }

    .portal-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .shop-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}
