:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1c1e21;
    --muted: #65676b;
    --line: #dddfe2;
    --accent: #e41e3f;
    --ok: #177245;
    --error: #ad2b2b;
    --brand: #1877f2;
    --fb-hover: #f2f3f5;
    --fb-blue-soft: #e7f3ff;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    position: relative;
    overflow-x: hidden;
}
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: auto;
}
#particle-network-layer {
    position: absolute;
    inset: 0;
}
#particle-canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.topbar-inner {
    width: min(1100px, 96vw);
    margin: 0 auto;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 8px 0;
}
.brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: -0.2px;
}
.menu {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.menu a {
    text-decoration: none;
    color: #1c1e21;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color .15s ease;
}
.menu a:hover {
    background: var(--fb-hover);
}
.menu a.active {
    background: var(--fb-blue-soft);
    color: #1b74e4;
    font-weight: 700;
}
.container { width: min(1100px, 96vw); margin: 18px auto 32px; }
.topbar, .container { position: relative; z-index: 10; }
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; margin-bottom: 10px; }
p.muted { color: var(--muted); margin-top: 6px; }
.flash { padding: 10px 12px; border-radius: 8px; margin-top: 10px; font-weight: 600; }
.flash.success { background: #e6f5eb; color: var(--ok); border: 1px solid #c7e7d3; }
.flash.error { background: #fbe9e9; color: var(--error); border: 1px solid #f2c6c6; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-span-2 { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; color: #3a3b3c; }
input, textarea, select {
    width: 100%;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    padding: 9px 10px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.12);
}
input.input-invalid, textarea.input-invalid, select.input-invalid { border-color: #d93025; background: #fff6f6; }
.field-error { color: #d93025; font-size: 12px; margin-top: 4px; min-height: 16px; }
.field-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.visually-hidden { position: absolute; left: -9999px; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
textarea { min-height: 88px; resize: vertical; }
.school-picker { position: relative; }
.school-dropdown {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #ccd0d5;
    border-radius: 8px;
    max-height: 220px;
    overflow: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    display: none;
}
.school-dropdown.open { display: block; }
.school-option {
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
}
.school-option:hover, .school-option.active { background: #eef4ff; }
.school-empty { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.dropzone {
    margin-top: 10px;
    border: 2px dashed #b8c1cc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #fafcff;
    cursor: pointer;
}
.dropzone.dragover { border-color: #1b74e4; background: #edf4ff; }
.actions { margin-top: 10px; }
.certificate-actions { margin-bottom: 14px; }
.certificate-link-wrap { margin-top: 14px; }
.certificates-list { margin-top: 26px !important; }
.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
    font: inherit;
}
.btn-main { background: #42b72a; color: #fff; }
.btn-main:hover { background: #35a420; }
.btn-filter { background: #e4e6eb; color: #050505; }
.btn-filter:hover { background: #d8dade; }
.btn-register-big {
    display: inline-block;
    text-decoration: none;
    background: #1877f2;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 800;
}
.btn-register-big:hover { background: #166fe5; }

.feed-col { display: flex; flex-direction: column; gap: 12px; }
.feed-filter {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.feed-filter form { display: flex; gap: 8px; width: 100%; }
.feed-post {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
    padding: 12px;
}
.post-head { display: flex; gap: 10px; align-items: center; }
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e7f3ff;
    color: #1b74e4;
    display: grid;
    place-items: center;
    font-weight: 800;
}
.post-name { font-weight: 700; font-size: 15px; }
.post-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.post-body { margin-top: 10px; }
.work-title {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    color: #050505;
    margin-bottom: 8px;
}
.post-row { font-size: 14px; margin-bottom: 6px; }
.post-row strong { color: #111; }
.prompt-box {
    font-size: 14px;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 6px;
    padding: 10px;
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}
details.lyrics { margin-top: 8px; }
details.lyrics summary {
    cursor: pointer;
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}
audio { width: 100%; margin-top: 10px; }
.post-foot {
    margin-top: 10px;
    border-top: 1px solid #eceff3;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.vote-area { display: flex; align-items: center; gap: 8px; }
.heart {
    border: 1px solid #e0245e !important;
    background: #e0245e !important;
    color: #ffffff !important;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}
.heart:hover {
    background: #c81e53 !important;
    border-color: #c81e53 !important;
}
.heart[disabled] { opacity: 0.45; cursor: not-allowed; }
.votes { font-size: 13px; color: var(--muted); font-weight: 700; }
.ajax-msg { font-size: 13px; min-height: 18px; color: var(--muted); }
.ajax-msg.ok { color: var(--ok); }
.ajax-msg.err { color: var(--error); }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pagination-info {
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}
.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.rules p { margin-bottom: 10px; line-height: 1.45; }
.radio-wrap { display: grid; gap: 10px; }
.radio-player-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.radio-nowplaying {
    font-size: 15px;
    font-weight: 700;
    color: #1c1e21;
}
.radio-vote-wrap {
    display: grid;
    justify-items: end;
    gap: 4px;
    min-width: 170px;
}
.radio-vote-wrap .ajax-msg {
    min-height: 16px;
    text-align: right;
}
.radio-list-wrap {
    border-top: 1px solid #eceff3;
    padding-top: 10px;
}
.radio-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
.radio-item {
    width: 100%;
    text-align: left;
    border: 1px solid #d7dbe1;
    border-radius: 8px;
    background: #fff;
    color: #1c1e21;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
}
.radio-item:hover { background: #f3f6fb; }
.radio-item.active {
    border-color: #1877f2;
    background: #e7f3ff;
}
.cookie-consent {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 60;
    background: #ffffff;
    border: 1px solid #ccd0d5;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
.cookie-consent-text {
    color: #1c1e21;
    font-size: 14px;
    line-height: 1.35;
}
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.label-inline {
    margin: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .feed-filter form { flex-direction: column; }
    .radio-player-row { grid-template-columns: 1fr; }
    .radio-vote-wrap {
        justify-items: start;
        min-width: 0;
    }
    .radio-vote-wrap .ajax-msg { text-align: left; }
    .cookie-consent {
        flex-direction: column;
        align-items: flex-start;
    }
}
