:root {
    --bg:#0f1724;
    --card:#0b1220;
    --text:#e6eef8;
    --accent1:#6ee7b7;
    --accent2:#60a5fa;
    --muted:rgba(255,255,255,0.65);
    --max-width:1100px;
    --radius:14px;
    --shadow:0 6px 30px rgba(2,6,23,0.6);
    --gap:20px;
    font-family: Inter, system-ui, sans-serif;
  }
  
  *{box-sizing:border-box;margin:0;padding:0}
  html,body{height:100%}
  body{
    background:var(--bg);
    color:var(--text);
    -webkit-font-smoothing:antialiased;
    padding:40px 20px;
    display:flex;
    justify-content:center;
  }
  .container{
    width:100%;
    max-width:var(--max-width);
    display:flex;
    flex-direction:column;
  }
  
  /* =========================
     HEADER / FOOTER
  ========================= */
  .site-header, .site-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:var(--gap);
  }
  .site-header{margin-bottom:28px}
  .brand{
    display:flex;
    align-items:center;
    gap:12px;
    text-decoration:none;
    color:inherit;
  }
  .logo{
    width:48px;
    height:48px;
  }
  .site-nav{display:flex;gap:12px;align-items:center}
  .btn{
    display:inline-block;
    padding:10px 18px;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    background:linear-gradient(90deg,var(--accent1),var(--accent2));
    color:#05223a;
    box-shadow:var(--shadow);
    transition:opacity .18s,transform .12s;
    white-space:nowrap;
    border:none;
    cursor:pointer;
  }
  .btn:hover{opacity:0.92;transform:translateY(-1px)}
  .btn.ghost{
    background:transparent;
    border:1px solid rgba(255,255,255,0.06);
    color:var(--muted);
    box-shadow:none;
  }
  .btn.primary{
    background:linear-gradient(90deg,var(--accent2),var(--accent1));
    color:#05223a;
  }
  .site-footer{
    color:var(--muted);
    font-size:13px;
    flex-wrap:wrap;
    gap:8px;
    margin-top:18px;
    padding-bottom:18px;
  }
  .site-footer a{color:var(--muted);text-decoration:underline}
  
  /* =========================
     STRONA GŁÓWNA
  ========================= */
  main{display:flex;flex-direction:column;gap:24px}
  .hero{
    background:rgba(255,255,255,0.03);
    padding:48px;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    text-align:center;
  }
  .title{font-size:40px;line-height:1.2;margin-bottom:12px}
  .desc{color:var(--muted);margin-bottom:18px;font-size:18px}
  .note{color:var(--muted);font-size:14px;margin-top:12px}
  .features{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:18px
  }
  .feature{
    background:rgba(255,255,255,0.02);
    border-radius:12px;
    padding:18px
  }
  .feature h3{margin-bottom:8px;font-size:18px}
  .feature p{color:var(--muted);font-size:14px;line-height:1.5}
  .wrap{
    width:100%;
    background:rgba(255,255,255,0.02);
    padding:28px;
    border-radius:12px;
    display:flex;
    flex-direction:column;
    gap:12px
  }
  .wrap h2{font-size:16px;margin:0 0 4px;color:var(--accent2)}
  .wrap h3{font-size:15px;margin:8px 0 4px}
  p, li{color:var(--muted);line-height:1.5}
  ol{padding-left:18px}
  .meta{font-size:13px;color:var(--muted);margin-bottom:10px}
  .wrap ul{padding-left:18px}
  .wrap a{color:var(--accent2);text-decoration:underline}
  
  /* =========================
     CZAT
  ========================= */
  .chat-root{
    flex:1;
    padding:18px;
    border-radius:var(--radius);
    background:linear-gradient(rgba(255,255,255,0.02));
    box-shadow:0 8px 40px rgba(2,6,23,0.6);
    display:flex;
    flex-direction:column;
    gap:12px;
    min-height:calc(100vh - 175px);
  }
  .chat-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:4px 8px;
  }
  .chat-header .brand{font-weight:700;font-size:18px}
  .status{
    font-size:13px;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:0.08em;
  }
  .chat-main{
    background:rgba(255,255,255,0.02);
    border-radius:10px;
    padding:14px;
    overflow:auto;
    flex:1;
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  /* Wiadomości */
  .msg{
    max-width:80%;
    padding:0px 10px;
    border-radius:6px;
    font-size:16px;
    position:relative;
    white-space:pre-wrap;
    color:#fff;
    background:transparent;
  }
  .msg.system{
    align-self:center;
    background:transparent;
    color:var(--muted);
    font-size:13px;
  }
  .msg .label{font-weight:600;margin-right:4px}
  .msg.me .label{color:var(--accent2)}
  .msg.other .label{color:var(--accent1)}
  .msg .time {
    display: none;
    position: absolute;
    bottom: -30px;
    left: 8px;
    font-size: 14px;
    color: #fff;
    background: rgba(0,0,0,0.8);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
  }
  .msg:hover .time {
    display: block;
  }
  /* Kontrolki */
  .chat-controls{display:flex;flex-direction:row;gap:8px;padding-top:6px;align-items:center}
  .inline{color:var(--muted);font-size:13px}
  .ws-input{
    flex:1;
    padding:8px 10px;
    border-radius:8px;
    border:1px solid rgba(255,255,255,0.04);
    background:transparent;
    color:var(--text)
  }
  .controls-bottom{display:flex;gap:8px}
  .msg-input{
    flex:1;
    padding:10px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,0.04);
    background:transparent;
    color:var(--text)
  }
  .chat-footer{
    font-size:13px;
    color:var(--muted);
    text-align:center;
    padding-top:4px
  }
  
  /* =========================
     RESPONSYWNOŚĆ
  ========================= */
  @media (max-width:640px){
    body{padding:14px}
    .site-footer {display: none;}
    .hero{padding:28px}
    .title{font-size:28px}
    .logo{width:40px;height:40px}
    .btn{padding:8px 12px}
    .site-header{margin-bottom: 14px}
    .chat-root{padding:12px;min-height:calc(100vh - 85px);}
    .controls-top{flex-direction:column;align-items:stretch}
    .ws-input{width:100%}
  }
/* =========================
   OGŁOSZENIA
========================= */
.announcements {
    width: 100%;
    background: rgba(255,255,255,0.02);
    padding: 28px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

    .announcements h2 {
        font-size: 18px;
        color: var(--accent2);
    }

.announcement-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.announcement {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .announcement h3 {
        font-size: 16px;
        color: var(--text); /* białe tytuły */
        align-self: center;
    }

    .announcement p {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.5;
    }

    .announcement .meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 4px;
    }

    .announcement .btn.small {
        align-self: flex-start;
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 8px;
        box-shadow: none;
        align-self: flex-start;
    }

.announcements-footer {
    text-align: center;
    margin-top: 10px;
}

    .announcements-footer .btn {
        margin-top: 8px;
    }

/* =========================
   STRONA OGŁOSZEŃ
========================= */

.announcements-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}

    .announcements-grid .announcement {
        background: rgba(255,255,255,0.03);
        border-radius: 10px;
        padding: 18px;
        box-shadow: var(--shadow);
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

        .announcements-grid .announcement h3 {
            font-size: 16px;
            color: var(--text);
            text-align: center;
        }

        .announcements-grid .announcement p {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.5;
        }

    .announcements-grid .meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 6px;
    }

        .announcements-grid .meta span {
            font-size: 13px;
            color: var(--muted);
        }

    .announcements-grid .btn.small {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 8px;
        box-shadow: none;
    }
   /* =========================
   OGRANICZENIE DŁUGOŚCI TEKSTU (Wersja z przyciskiem w linii)
========================= */

.announcements-grid .announcement {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
        min-height: 185px;
}

/* --- STYL DLA ZWINIĘTEGO OGŁOSZENIA --- */

.announcement.is-collapsible:not(.is-expanded) .text {
    position: relative;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ...jego przycisk "pokaż więcej"... */
.announcement.is-collapsible:not(.is-expanded) .show-more {
    position: absolute;
    bottom: 0;
    right: 0;
    width: auto;
    display: inline;
    background: var(--card);
    padding-left: 4px;
}

.announcement.is-collapsible:not(.is-expanded) .show-more::before {
    content: '... ';
}


/* --- STYL DLA ROZWINIĘTEGO OGŁOSZENIA --- */

.announcement.is-expanded .show-more {
    position: static;
    display: inline;
    background: transparent;
    padding-left: 4px;
}

.announcement.is-expanded .show-more::before {
    content: '';
}

/* --- OGÓLNE STYLE PRZYCISKU --- */

.announcement .show-more {
    color: var(--accent2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}