* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #08101d;
    --panel: rgba(16, 27, 46, 0.94);
    --panel-soft: rgba(23, 38, 62, 0.9);
    --line: rgba(142, 173, 214, 0.18);
    --text: #f5f8ff;
    --muted: #9fb0c8;
    --accent: #45a8ff;
    --accent-2: #6ce2ff;
    --danger: #ff6677;
    --success: #55d89a;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(41, 128, 206, 0.25), transparent 34rem),
        radial-gradient(circle at 100% 30%, rgba(78, 61, 180, 0.16), transparent 32rem),
        linear-gradient(160deg, #07101c 0%, #0b1728 55%, #08101d 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button, input, textarea {
    font: inherit;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

.page {
    width: min(1268px, calc(100% - 28px));
    margin: 0 auto;
    padding: 52px 0 28px;
    display: grid;
    grid-template-columns: minmax(0, 920px) minmax(280px, 320px);
    grid-template-areas:
        "hero announcement"
        "counter announcement"
        "shoutbox announcement"
        "footer announcement";
    column-gap: 28px;
    align-items: start;
}

.hero {
    grid-area: hero;
    padding: 22px 8px 30px;
    text-align: center;
}

.brand {
    display: inline-block;
    margin-bottom: 18px;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 0 24px rgba(69, 168, 255, 0.4);
}

.status {
    width: max-content;
    max-width: 100%;
    margin: 0 auto 15px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 193, 89, 0.28);
    border-radius: 999px;
    color: #ffd38b;
    background: rgba(141, 91, 10, 0.16);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.status span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #ffbd4a;
    box-shadow: 0 0 14px #ffbd4a;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 7vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.hero p {
    max-width: 610px;
    margin: 16px auto 0;
    color: var(--muted);
    font-size: clamp(0.98rem, 2.5vw, 1.1rem);
    line-height: 1.65;
}


.online-counter-section {
    grid-area: counter;
    display: flex;
    justify-content: center;
    margin: -10px 0 28px;
    padding: 0 8px;
}

.online-counter-box {
    min-width: 230px;
    padding: 10px 16px 11px;
    border: 2px solid rgba(125, 205, 255, 0.95);
    border-bottom: 4px solid #0b3154;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(180deg, rgba(20, 41, 86, 0.96), rgba(7, 17, 48, 0.96));
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    text-align: center;
    text-shadow: 1px 1px #061c34;
    box-shadow:
        0 3px 0 rgba(0, 25, 55, 0.75),
        0 0 13px rgba(64, 175, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.online-counter-label {
    display: block;
    font-size: 13px;
    line-height: 15px;
    opacity: 0.92;
    white-space: nowrap;
}

.online-counter-value {
    display: block;
    margin-top: 3px;
    color: #ffe65a;
    font-size: 24px;
    line-height: 27px;
}


.server-expansion-card {
    grid-area: announcement;
    position: sticky;
    top: 22px;
    overflow: hidden;
    margin-top: 22px;
    padding: 25px 23px 23px;
    border: 1px solid rgba(255, 193, 89, 0.28);
    border-radius: 22px;
    color: #eaf3ff;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 184, 72, 0.14), transparent 15rem),
        linear-gradient(160deg, rgba(20, 34, 57, 0.98), rgba(10, 21, 38, 0.98));
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(16px);
}

.server-expansion-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #ffbd4a, #6ce2ff);
}

.server-expansion-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #ffd38b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.server-expansion-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #ffbd4a;
    box-shadow: 0 0 14px rgba(255, 189, 74, 0.9);
}

.server-expansion-card h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.42rem, 2vw, 1.75rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.server-expansion-card p {
    margin: 15px 0 0;
    color: #b7c7dc;
    font-size: 0.94rem;
    line-height: 1.62;
}

.server-expansion-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.server-expansion-highlights span {
    padding: 7px 10px;
    border: 1px solid rgba(108, 226, 255, 0.25);
    border-radius: 999px;
    color: #dff8ff;
    background: rgba(69, 168, 255, 0.1);
    font-size: 0.76rem;
    font-weight: 800;
}

.server-expansion-card .server-expansion-community {
    padding-top: 15px;
    border-top: 1px solid rgba(142, 173, 214, 0.14);
}

.server-expansion-card .server-expansion-more {
    padding: 13px 14px;
    border: 1px solid rgba(255, 193, 89, 0.22);
    border-radius: 13px;
    color: #ffe0a6;
    background: rgba(141, 91, 10, 0.12);
    font-weight: 750;
}

.shoutbox {
    grid-area: shoutbox;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent);
}

.panel-header h1,
.panel-header h2 {
    margin: 3px 0 0;
    font-size: 1.45rem;
}

.eyebrow {
    color: var(--accent-2);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.refresh-button,
.link-button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(88, 180, 255, 0.28);
    border-radius: 11px;
    color: #ddecff;
    background: rgba(69, 168, 255, 0.09);
    cursor: pointer;
    text-decoration: none;
}

.refresh-button:hover {
    background: rgba(69, 168, 255, 0.16);
}

#messageForm {
    padding: 24px 26px 20px;
    border-bottom: 1px solid var(--line);
}

.form-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 2fr) auto;
    gap: 12px;
    align-items: end;
}

.field {
    display: grid;
    gap: 8px;
}

.field > span {
    color: #c7d5e7;
    font-size: 0.82rem;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(157, 183, 219, 0.2);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: rgba(4, 10, 19, 0.55);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input {
    height: 50px;
    padding: 0 14px;
}

textarea {
    min-height: 50px;
    max-height: 160px;
    padding: 13px 14px;
    resize: vertical;
    line-height: 1.4;
}

input:focus,
textarea:focus {
    border-color: rgba(69, 168, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(69, 168, 255, 0.12);
}

.send-button {
    height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    color: #04101f;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(69, 168, 255, 0.2);
}

.send-button:hover {
    filter: brightness(1.08);
}

.send-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.78rem;
}

.hidden-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.notice {
    display: none;
    margin-top: 13px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.87rem;
}

.notice.visible {
    display: block;
}

.notice.success {
    color: #baf7d8;
    background: rgba(34, 146, 91, 0.16);
    border: 1px solid rgba(85, 216, 154, 0.25);
}

.notice.error {
    color: #ffd2d7;
    background: rgba(179, 49, 66, 0.16);
    border: 1px solid rgba(255, 102, 119, 0.25);
}

.messages {
    min-height: 250px;
    max-height: 590px;
    overflow-y: auto;
    padding: 8px 26px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(103, 148, 199, 0.45) transparent;
}

.message-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 13px;
    padding: 17px 0;
    border-bottom: 1px solid rgba(145, 173, 211, 0.11);
}

.message-item:last-child {
    border-bottom: 0;
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(99, 187, 255, 0.28);
    border-radius: 12px;
    color: #dff3ff;
    background: linear-gradient(145deg, rgba(69, 168, 255, 0.18), rgba(65, 82, 154, 0.12));
    font-weight: 900;
}

.message-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.message-head strong {
    color: #f7fbff;
    font-size: 0.95rem;
}

.message-head time {
    color: #788ba5;
    font-size: 0.74rem;
}

.message-text {
    margin: 5px 0 0;
    color: #c8d4e4;
    font-size: 0.94rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.loading,
.empty-state {
    padding: 46px 12px;
    text-align: center;
    color: var(--muted);
}

footer {
    grid-area: footer;
    padding: 24px 0 0;
    text-align: center;
    color: #65768f;
    font-size: 0.78rem;
}

.admin-page {
    max-width: 920px;
}

.admin-panel {
    padding-bottom: 22px;
}

.admin-login {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 26px;
}

.admin-info {
    margin: 0;
    padding: 18px 26px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.admin-list {
    padding: 8px 26px 22px;
}

.admin-message {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.admin-message time {
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-message p {
    margin: 7px 0 0;
    color: #c8d4e4;
    line-height: 1.5;
}

.delete-button {
    min-width: 74px;
    height: 38px;
    border: 1px solid rgba(255, 102, 119, 0.3);
    border-radius: 10px;
    color: #ffc7ce;
    background: rgba(255, 102, 119, 0.1);
    cursor: pointer;
}

.back-link {
    display: inline-block;
    margin: 0 26px;
    color: #a9cdf1;
    text-decoration: none;
}


/* Awaryjny tryb dla przeglądarek ignorujących stałą szerokość viewportu. */
@media (max-width: 1099px) {
    html, body {
        min-width: 900px;
    }

    .page {
        width: 872px;
        grid-template-columns: minmax(0, 584px) 260px;
        grid-template-areas:
            "hero announcement"
            "counter announcement"
            "shoutbox announcement"
            "footer announcement";
        column-gap: 28px;
    }

    .server-expansion-card {
        position: sticky;
        top: 14px;
        margin: 22px 0 0;
    }
}

@media (max-width: 760px) {

    .online-counter-section {
        margin-top: -4px;
        margin-bottom: 22px;
    }

    .online-counter-box {
        min-width: 198px;
        padding: 8px 13px 9px;
        border-radius: 10px;
    }

    .online-counter-label {
        font-size: 12px;
        line-height: 14px;
    }

    .online-counter-value {
        font-size: 21px;
        line-height: 24px;
    }

    .page {
        width: min(100% - 18px, 920px);
        padding-top: 24px;
    }

    .server-expansion-card {
        margin: 0 0 22px;
        padding: 21px 18px 19px;
        border-radius: 18px;
    }

    .hero {
        padding: 14px 8px 24px;
    }

    .shoutbox {
        border-radius: 18px;
    }

    .panel-header,
    #messageForm {
        padding-left: 17px;
        padding-right: 17px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .send-button {
        width: 100%;
    }

    .messages {
        max-height: none;
        padding-left: 17px;
        padding-right: 17px;
    }

    .admin-login {
        grid-template-columns: 1fr;
        padding: 20px 17px;
    }

    .admin-list {
        padding-left: 17px;
        padding-right: 17px;
    }

    .admin-message {
        align-items: flex-start;
    }
}

@media (max-width: 430px) {
    .panel-header {
        align-items: flex-start;
    }

    .refresh-button {
        min-height: 38px;
        padding: 0 11px;
        font-size: 0.8rem;
    }

    .message-item {
        grid-template-columns: 36px 1fr;
        gap: 10px;
    }

    .avatar {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .form-footer {
        font-size: 0.72rem;
    }

    .admin-message {
        display: grid;
    }
}

/* ==========================================================
   2026-08-07 — lewa ramka ArezzoMT2 + symetryczny układ 3 kolumn
   ========================================================== */
.page {
    width: min(1568px, calc(100% - 28px));
    grid-template-columns: minmax(240px, 300px) minmax(0, 920px) minmax(240px, 300px);
    grid-template-areas:
        "metin hero announcement"
        "metin counter announcement"
        "metin shoutbox announcement"
        "metin footer announcement";
    column-gap: 24px;
}

.metin-invite-card {
    grid-area: metin;
    position: sticky;
    top: 22px;
    overflow: hidden;
    margin-top: 22px;
    padding: 25px 23px 23px;
    border: 1px solid rgba(255, 193, 89, 0.28);
    border-radius: 22px;
    color: #eaf3ff;
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 184, 72, 0.14), transparent 15rem),
        linear-gradient(160deg, rgba(20, 34, 57, 0.98), rgba(10, 21, 38, 0.98));
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(16px);
}

.metin-invite-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #ffbd4a, #6ce2ff);
}

.metin-invite-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #ffd38b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.metin-invite-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #ffbd4a;
    box-shadow: 0 0 14px rgba(255, 189, 74, 0.9);
}

.metin-invite-card h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.42rem, 2vw, 1.75rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.metin-invite-card p {
    margin: 15px 0 0;
    color: #b7c7dc;
    font-size: 0.94rem;
    line-height: 1.62;
}

.metin-invite-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.metin-invite-highlights span {
    padding: 7px 10px;
    border: 1px solid rgba(108, 226, 255, 0.25);
    border-radius: 999px;
    color: #dff8ff;
    background: rgba(69, 168, 255, 0.10);
    font-size: 0.76rem;
    font-weight: 800;
}

.metin-invite-card .metin-invite-community {
    padding-top: 15px;
    border-top: 1px solid rgba(142, 173, 214, 0.14);
}

.metin-invite-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    padding: 10px 12px;
    border: 1px solid rgba(108, 226, 255, 0.42);
    border-bottom: 3px solid rgba(26, 102, 160, 0.82);
    border-radius: 12px;
    color: #061421;
    background: linear-gradient(135deg, #6ce2ff, #45a8ff);
    box-shadow:
        0 10px 25px rgba(69, 168, 255, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.035em;
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.metin-invite-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
        0 12px 30px rgba(69, 168, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.40);
}

.metin-invite-button:active {
    transform: translateY(1px);
}

/* Trochę ciaśniejsze kolumny na mniejszych monitorach, nadal lewa + środek + prawa. */
@media (max-width: 1567px) and (min-width: 1200px) {
    .page {
        width: calc(100% - 24px);
        grid-template-columns: minmax(220px, 0.32fr) minmax(650px, 1fr) minmax(220px, 0.32fr);
        column-gap: 20px;
    }

    .metin-invite-card,
    .server-expansion-card {
        padding-left: 19px;
        padding-right: 19px;
    }
}

/* Na węższym ekranie środek pozostaje czytelny, a ramka Metina schodzi pod licznik. */
@media (max-width: 1199px) {
    html,
    body {
        min-width: 900px;
    }

    .page {
        width: min(1072px, calc(100% - 28px));
        grid-template-columns: minmax(0, 1fr) 280px;
        grid-template-areas:
            "hero announcement"
            "counter announcement"
            "metin announcement"
            "shoutbox announcement"
            "footer announcement";
        column-gap: 24px;
    }

    .metin-invite-card {
        position: static;
        margin: 0 0 28px;
    }

    .server-expansion-card {
        top: 14px;
    }
}
