/* ==========================================================
   Community Chat Rooms - Stylesheet
   Pääväri: #d6111e | Kulta: #ddc76d | #000 | #fff
   ========================================================== */

/* ---------- Reset & muuttujat --------------------------------- */
:root {
    --ccr-red:       #d6111e;
    --ccr-red-dark:  #a80e18;
    --ccr-red-light: #f2303d;
    --ccr-gold:      #ddc76d;
    --ccr-teal:      #38c6c6;
    --ccr-gold-dark: #b8a244;
    --ccr-black:     #000000;
    --ccr-dark:      #111111;
    --ccr-dark2:     #1e1e1e;
    --ccr-dark3:     #2a2a2a;
    --ccr-mid:       #3a3a3a;
    --ccr-gray:      #888888;
    --ccr-light:     #cccccc;
    --ccr-white:     #ffffff;
    --ccr-font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    --ccr-radius:    6px;
    --ccr-shadow:    0 2px 12px rgba(0,0,0,.45);
    --ccr-msg-max:   700px;
    --ccr-sidebar-w: 200px;
    --ccr-chat-h:    520px;
}

/* ---------- Yleinen --------------------------------------------- */
.ccr-chat-wrap *,
.ccr-register-wrap *,
.ccr-rooms-list *,
.ccr-profile-page * {
    box-sizing: border-box;
}

/* ---------- Napit ----------------------------------------------- */
.ccr-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    border: none;
    border-radius: var(--ccr-radius);
    font-family: var(--ccr-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s, transform 0.1s;
    white-space: nowrap;
}

.ccr-btn:active { transform: scale(0.97); }

.ccr-btn-primary {
    background: var(--ccr-red);
    color: var(--ccr-white);
}
.ccr-btn-primary:hover { background: var(--ccr-red-dark); }

.ccr-btn-secondary {
    background: var(--ccr-dark3);
    color: var(--ccr-light);
    border: 1px solid var(--ccr-mid);
}
.ccr-btn-secondary:hover { background: var(--ccr-mid); }

.ccr-btn-gold {
    background: var(--ccr-gold);
    color: var(--ccr-black);
}
.ccr-btn-gold:hover { background: var(--ccr-gold-dark); color: var(--ccr-white); }

/* ---------- Ilmoitukset ---------------------------------------- */
.ccr-notice {
    padding: 10px 16px;
    border-radius: var(--ccr-radius);
    margin: 12px 0;
    font-size: 14px;
}
.ccr-notice-error, .ccr-error   { background: #3a0808; color: #f5a0a0; border-left: 4px solid var(--ccr-red); }
.ccr-notice-success, .ccr-success { background: #0a2e0a; color: #9ee89e; border-left: 4px solid #28a745; }
.ccr-notice-warning, .ccr-warning { background: #2e2200; color: var(--ccr-gold); border-left: 4px solid var(--ccr-gold); }

/* Tilapäinen ponnahdusilmoitus */
.ccr-temp-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    padding: 12px 20px;
    border-radius: var(--ccr-radius);
    font-family: var(--ccr-font);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--ccr-shadow);
    display: none;
}

/* ============================================================
   CHAT-HUONE
   ============================================================ */

.ccr-chat-wrap {
    background: var(--ccr-dark2);
    border: 1px solid var(--ccr-mid);
    border-radius: var(--ccr-radius);
    overflow: hidden;
    font-family: var(--ccr-font);
    font-size: 14px;
    color: var(--ccr-light);
    box-shadow: var(--ccr-shadow);
    margin: 24px 0;
}

/* ----- Header ----- */
.ccr-chat-header {
    background: var(--ccr-red);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ccr-hb-logo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    user-select: none;
}
.ccr-hb-logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--ccr-black);
    color: var(--ccr-gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}
.ccr-hb-logo-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--ccr-white);
    letter-spacing: .02em;
    text-transform: uppercase;
    opacity: .9;
}
.ccr-modal-header .ccr-hb-logo .ccr-hb-logo-mark { background: var(--ccr-red); color: var(--ccr-white); box-shadow: 0 0 0 1px var(--ccr-mid); }
.ccr-modal-header .ccr-hb-logo .ccr-hb-logo-text { color: var(--ccr-gray); }
.ccr-room-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ccr-white);
    flex: 1;
}
.ccr-room-desc {
    margin: 0;
    font-size: 12px;
    color: rgba(255,255,255,.75);
    width: 100%;
}
.ccr-room-meta {
    font-size: 13px;
    color: rgba(255,255,255,.85);
    background: rgba(0,0,0,.25);
    padding: 3px 10px;
    border-radius: 20px;
}

/* ----- Body: chat + sidebar ----- */
.ccr-chat-body {
    display: flex;
    height: var(--ccr-chat-h);
    overflow: hidden;
}

/* ----- Viestialue ----- */
.ccr-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--ccr-mid);
}

.ccr-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scroll-behavior: smooth;
    background: var(--ccr-dark);
}
.ccr-messages::-webkit-scrollbar { width: 6px; }
.ccr-messages::-webkit-scrollbar-track { background: transparent; }
.ccr-messages::-webkit-scrollbar-thumb { background: var(--ccr-mid); border-radius: 3px; }

.ccr-messages-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ccr-loading {
    color: var(--ccr-gray);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ----- Yksittäinen viesti ----- */
.ccr-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: var(--ccr-msg-max);
    animation: ccrFadeIn .18s ease;
}

@keyframes ccrFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ccr-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--ccr-mid);
    margin-top: 2px;
}

.ccr-msg-content { flex: 1; min-width: 0; }

.ccr-msg-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.ccr-msg-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    color: var(--ccr-white);
    background: var(--ccr-red);
    padding: 2px 9px;
    border-radius: 20px;
    transition: background 0.15s;
}
.ccr-msg-author:hover { background: var(--ccr-red-dark); color: var(--ccr-white); }

.ccr-role-sheriff .ccr-msg-author,
.ccr-msg-sheriff .ccr-msg-author {
    background: var(--ccr-gold);
    color: var(--ccr-black);
}
.ccr-role-sheriff .ccr-msg-author:hover,
.ccr-msg-sheriff .ccr-msg-author:hover {
    background: var(--ccr-gold-dark);
    color: var(--ccr-white);
}

.ccr-role-bot .ccr-msg-author {
    background: var(--ccr-teal);
    color: var(--ccr-black);
}
.ccr-role-bot .ccr-msg-author:hover {
    background: #2a9d9d;
    color: var(--ccr-white);
}

.ccr-msg-self .ccr-msg-author { background: var(--ccr-red-dark); }

.ccr-msg-time {
    font-size: 11px;
    color: var(--ccr-gray);
}

.ccr-msg-text {
    font-size: 14px;
    line-height: 1.45;
    color: var(--ccr-white);
    word-break: break-word;
    white-space: pre-wrap;
}

.ccr-msg-sheriff .ccr-msg-text {
    color: var(--ccr-white);
}

/* Poistettu viesti */
.ccr-msg-deleted em { color: var(--ccr-gray); font-size: 13px; }

/* Järjestelmäviesti (yleinen, esim. potkut) */
.ccr-msg-system {
    justify-content: center;
    text-align: center;
}
.ccr-system-text {
    font-size: 12px;
    font-style: italic;
    color: var(--ccr-gray);
    background: var(--ccr-dark3);
    padding: 3px 12px;
    border-radius: 10px;
}

/* Liittymis- ja poistumisviestit: vasemmalla, valkoisella tekstillä */
.ccr-msg-join,
.ccr-msg-leave {
    justify-content: flex-start;
    text-align: left;
}
.ccr-msg-join .ccr-system-text,
.ccr-msg-leave .ccr-system-text {
    color: var(--ccr-white);
    background: transparent;
    font-style: normal;
    font-size: 12.5px;
    padding: 2px 0;
}
.ccr-msg-join .ccr-system-text::before { content: '→ '; color: var(--ccr-gold); }
.ccr-msg-leave .ccr-system-text::before { content: '← '; color: var(--ccr-gray); }

/* ----- Reaktiopalkki (peukutus + tiktok-tyyliset emoji-reaktiot) ----- */
.ccr-reaction-bar {
    margin-top: 5px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.ccr-reaction-bar-static {
    font-size: 12px;
    color: var(--ccr-gray);
}
.ccr-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    border-radius: 14px;
    padding: 2px 8px;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s, border-color 0.15s;
    font-size: 13px;
}
.ccr-reaction-btn:hover { background: var(--ccr-mid); transform: translateY(-1px) scale(1.05); }
.ccr-reaction-btn.is-active {
    background: rgba(214,17,30,.18);
    border-color: var(--ccr-red);
}
.ccr-reaction-emoji { font-size: 14px; line-height: 1; }
.ccr-reaction-count { font-size: 11px; font-weight: 700; color: var(--ccr-light); }

/* Toimintopainikkeet viestin yhteydessä */
.ccr-msg-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ccr-action-btn {
    background: none;
    border: 1px solid var(--ccr-mid);
    color: var(--ccr-gray);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}
.ccr-action-btn:hover { background: var(--ccr-mid); color: var(--ccr-white); }
.ccr-report-btn:hover { border-color: var(--ccr-gold); color: var(--ccr-gold); }
.ccr-delete-msg-btn:hover { border-color: var(--ccr-red); color: var(--ccr-red-light); }

/* ----- Input-alue ----- */
.ccr-chat-input-area {
    padding: 10px 12px;
    background: var(--ccr-dark2);
    border-top: 1px solid var(--ccr-mid);
}

.ccr-input-row {
    display: flex;
    gap: 8px;
}

.ccr-message-input {
    flex: 1;
    background: var(--ccr-dark3);
    border: 1.5px solid var(--ccr-mid);
    border-radius: var(--ccr-radius);
    padding: 9px 14px;
    color: var(--ccr-white);
    font-family: var(--ccr-font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.ccr-message-input:focus {
    border-color: var(--ccr-red);
    box-shadow: 0 0 0 3px rgba(214,17,30,.2);
}
.ccr-message-input::placeholder { color: var(--ccr-gray); }
.ccr-message-input:disabled { opacity: 0.5; cursor: not-allowed; }

.ccr-chat-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ccr-chat-notice {
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

.ccr-login-notice {
    padding: 14px 16px;
    background: var(--ccr-dark3);
    border-top: 1px solid var(--ccr-mid);
    font-size: 13px;
    color: var(--ccr-gray);
    text-align: center;
}
.ccr-login-notice a { color: var(--ccr-gold); text-decoration: none; }
.ccr-login-notice a:hover { text-decoration: underline; }

/* ----- Sidebar / käyttäjälista ----- */
.ccr-sidebar {
    width: var(--ccr-sidebar-w);
    background: var(--ccr-dark2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.ccr-sidebar-left {
    width: var(--ccr-sidebar-w);
    background: var(--ccr-dark2);
    border-right: 1px solid var(--ccr-mid);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.ccr-sidebar-header {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ccr-gray);
    background: var(--ccr-dark3);
    border-bottom: 1px solid var(--ccr-mid);
}

.ccr-sidebar-section {
    flex-shrink: 0;
    border-bottom: 1px solid var(--ccr-mid);
}

/* ----- Omat reaktiot ----- */
.ccr-own-reactions-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ccr-own-reaction-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--ccr-light);
}
.ccr-own-reaction-row strong { color: var(--ccr-gold); font-size: 13px; }
.ccr-own-reactions-loading { font-size: 12px; color: var(--ccr-gray); font-style: italic; padding: 10px 14px; display: block; }

/* ----- Kanavat ----- */
.ccr-channel-list {
    list-style: none !important;
    margin: 0;
    padding: 6px;
    max-height: 160px;
    overflow-y: auto;
}
.ccr-channel-list li,
.ccr-channel-item { list-style: none !important; margin-bottom: 2px; }
.ccr-channel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12.5px;
    color: var(--ccr-light);
    transition: background 0.12s, color 0.12s;
}
.ccr-channel-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ccr-mid);
}
.ccr-channel-dot.is-active {
    background: #34c759;
    box-shadow: 0 0 6px rgba(52,199,89,.7);
}
.ccr-channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccr-channel-count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--ccr-gray);
    background: var(--ccr-dark3);
    border-radius: 10px;
    padding: 1px 7px;
}
.ccr-channel-item.is-current .ccr-channel-count { color: var(--ccr-gold); }
.ccr-channel-empty { font-size: 12px; color: var(--ccr-gray); font-style: italic; padding: 6px 10px; }

.ccr-user-list {
    list-style: none !important;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
}
.ccr-user-list li,
.ccr-user-item { list-style: none !important; }
.ccr-user-list::-webkit-scrollbar { width: 4px; }
.ccr-user-list::-webkit-scrollbar-thumb { background: var(--ccr-mid); border-radius: 2px; }

.ccr-user-item {
    position: relative;
}

.ccr-user-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    text-decoration: none;
    color: var(--ccr-light);
    font-size: 13px;
    transition: background 0.12s;
}

.ccr-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--ccr-mid);
    flex-shrink: 0;
}

.ccr-user-icon { display: none; } /* poistettu "bulletti"-kuvake nimen edestä */

.ccr-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    color: var(--ccr-light);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ccr-user-link:hover .ccr-user-name {
    background: var(--ccr-red);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}

.ccr-role-sheriff .ccr-user-name { color: var(--ccr-gold); border-color: rgba(221,199,109,.4); }
.ccr-role-sheriff .ccr-user-link:hover .ccr-user-name {
    background: var(--ccr-red);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}
.ccr-role-bot .ccr-user-name { color: var(--ccr-teal); border-color: rgba(56,198,198,.4); }
.ccr-role-bot .ccr-user-link:hover .ccr-user-name {
    background: var(--ccr-red);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}

/* Sheriffi-toiminnot listassa */
.ccr-sheriff-actions {
    display: flex;
    gap: 4px;
    padding: 0 8px 4px 12px;
}

/* Sheriffi-paneeli */
.ccr-sheriff-panel {
    border-top: 1px solid var(--ccr-mid);
    padding: 8px;
}
.ccr-sheriff-panel-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ccr-gold);
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 0 0 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .02em;
    transition: border-color 0.15s, background 0.15s;
}
.ccr-sheriff-panel-trigger::after {
    content: '→';
    font-weight: 400;
    opacity: .7;
}
.ccr-sheriff-panel-trigger:hover { border-color: var(--ccr-gold); background: var(--ccr-mid); }
.ccr-sheriff-notif {
    font-size: 12px;
    padding: 5px 8px;
    background: #2e1a00;
    border-left: 3px solid var(--ccr-gold);
    border-radius: 3px;
    margin-bottom: 4px;
    color: var(--ccr-light);
}

/* ============================================================
   MODERNI MODAALI-IKKUNA (sheriffi-paneeli / kirjautumisvaatimus)
   ============================================================ */

body.ccr-modal-open { overflow: hidden; }

.ccr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: var(--ccr-font);
}
.ccr-modal-overlay.is-visible { opacity: 1; }
.ccr-modal-overlay.is-collapsing {
    opacity: 0;
    pointer-events: none;
}
.ccr-modal-overlay.is-collapsing .ccr-modal {
    transform: translateY(40px) scale(.9);
    opacity: 0;
}

.ccr-modal {
    background: linear-gradient(165deg, var(--ccr-dark2) 0%, var(--ccr-black) 100%);
    border: 1px solid var(--ccr-mid);
    border-radius: 16px;
    width: 92%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    transform: translateY(16px) scale(.97);
    transition: transform 0.22s ease, opacity 0.22s ease;
    overflow: hidden;
}
.ccr-modal-overlay.is-visible .ccr-modal { transform: translateY(0) scale(1); }
.ccr-modal-small { max-width: 380px; }

.ccr-modal-room {
    max-width: 820px;
    width: 92%;
    height: 78vh;
    max-height: 640px;
}
.ccr-modal-room .ccr-modal-header {
    padding: 16px 18px 10px;
    border-bottom: 1px solid var(--ccr-mid);
    margin-bottom: 0;
    flex-shrink: 0;
}
.ccr-modal-chat-wrap {
    flex: 1;
    display: flex;
    min-height: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.ccr-modal-room .ccr-chat-body {
    flex: 1;
    height: auto;
    min-height: 0;
}

.ccr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 10px;
}
.ccr-modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: var(--ccr-white);
}
.ccr-modal-close {
    background: var(--ccr-dark3);
    border: none;
    color: var(--ccr-light);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ccr-modal-close:hover { background: var(--ccr-red); color: var(--ccr-white); transform: rotate(90deg); }

.ccr-modal-subtitle {
    margin: 0 20px 14px;
    font-size: 12.5px;
    color: var(--ccr-gray);
}

.ccr-modal-user-list {
    list-style: none;
    margin: 0;
    padding: 0 10px 14px;
    overflow-y: auto;
}
.ccr-modal-user-list .ccr-user-item {
    border-radius: 10px;
    margin-bottom: 4px;
    background: var(--ccr-dark3);
}
.ccr-modal-user-list .ccr-user-link { padding: 8px 12px; }
.ccr-modal-user-list .ccr-sheriff-actions { padding: 0 12px 10px; }
.ccr-modal-empty {
    text-align: center;
    color: var(--ccr-gray);
    font-size: 13px;
    padding: 20px 0;
}

.ccr-modal-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}
.ccr-modal-actions .ccr-btn { flex: 1; text-align: center; text-decoration: none; }

/* ============================================================
   HUONELISTAUS [chat_rooms]
   ============================================================ */

.ccr-rooms-list { margin: 24px 0; font-family: var(--ccr-font); }

.ccr-rooms-title {
    font-size: 22px;
    color: var(--ccr-red);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--ccr-mid);
    padding-bottom: 8px;
}

.ccr-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.ccr-room-card {
    background: var(--ccr-dark2);
    border: 1px solid var(--ccr-mid);
    border-radius: var(--ccr-radius);
    padding: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: var(--ccr-font);
    color: var(--ccr-light);
}
.ccr-room-card:hover {
    border-color: var(--ccr-red);
    box-shadow: 0 0 0 2px rgba(214,17,30,.15);
}

.ccr-room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ccr-room-card-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ccr-white);
}
.ccr-room-card-link { text-decoration: none; }
.ccr-room-card-link:hover .ccr-room-card-name { color: var(--ccr-gold); }

.ccr-room-card-join {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ccr-white);
    background: var(--ccr-red);
    padding: 6px 14px;
    border-radius: var(--ccr-radius);
    text-decoration: none;
    transition: background 0.15s;
}
.ccr-room-card-join:hover { background: var(--ccr-red-dark); }

.ccr-room-card-count {
    font-size: 12px;
    color: var(--ccr-gray);
    background: var(--ccr-dark3);
    padding: 2px 8px;
    border-radius: 10px;
}
.ccr-count-number { color: var(--ccr-gold); font-weight: 700; }

.ccr-room-card-desc {
    font-size: 13px;
    color: var(--ccr-white);
    margin: 0 0 10px;
}

.ccr-room-card-users {
    list-style: none !important;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 4px;
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
}

.ccr-room-preview-user-item { list-style: none !important; display: block; }

.ccr-room-preview-user {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.12s;
}

.ccr-room-preview-user img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ccr-mid);
    display: block;
    flex-shrink: 0;
    transition: border-color 0.15s;
}
.ccr-room-preview-user:hover img { border-color: var(--ccr-red); }
.ccr-room-preview-user.ccr-role-sheriff img { border-color: var(--ccr-gold); }
.ccr-room-preview-user.ccr-role-bot img { border-color: var(--ccr-teal); }

.ccr-room-preview-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ccr-white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--ccr-red);
    border: 1px solid var(--ccr-red-dark);
    padding: 3px 10px;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ccr-room-preview-user:hover .ccr-room-preview-name {
    background: var(--ccr-red-dark);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}
.ccr-room-preview-user.ccr-role-sheriff .ccr-room-preview-name { background: var(--ccr-gold); color: var(--ccr-black); border-color: var(--ccr-gold-dark); }
.ccr-room-preview-user.ccr-role-sheriff:hover .ccr-room-preview-name {
    background: var(--ccr-red);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}
.ccr-room-preview-user.ccr-role-bot .ccr-room-preview-name { background: var(--ccr-teal); color: var(--ccr-black); border-color: #2a9d9d; }
.ccr-room-preview-user.ccr-role-bot:hover .ccr-room-preview-name {
    background: var(--ccr-red);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}

.ccr-room-preview-empty {
    font-size: 12.5px;
    color: var(--ccr-gray);
    font-style: italic;
    padding: 4px 6px;
}

.ccr-more-users {
    font-size: 12px;
    color: var(--ccr-gray);
    padding: 3px 7px;
    text-align: center;
}

/* ============================================================
   REKISTERÖINTILOMAKE [chat_register]
   ============================================================ */

.ccr-register-wrap {
    max-width: 420px;
    margin: 32px auto;
    font-family: var(--ccr-font);
}

.ccr-dark-card {
    background: linear-gradient(160deg, var(--ccr-dark2) 0%, var(--ccr-dark) 100%);
    border: 1px solid var(--ccr-mid);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: var(--ccr-shadow), inset 0 1px 0 rgba(255,255,255,.03);
}

.ccr-register-brand {
    text-align: center;
    font-size: 34px;
    margin-bottom: 4px;
}

.ccr-register-title {
    font-size: 22px;
    color: var(--ccr-white);
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ccr-red);
    background: linear-gradient(90deg, var(--ccr-white), var(--ccr-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ccr-checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12.5px;
    color: var(--ccr-light);
    line-height: 1.5;
    cursor: pointer;
}
.ccr-checkbox-field input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--ccr-red);
    flex-shrink: 0;
    cursor: pointer;
}
.ccr-checkbox-field a { color: var(--ccr-gold); text-decoration: none; }
.ccr-checkbox-field a:hover { text-decoration: underline; }

/* "Olet jo kirjautunut sisään" -kortti */
.ccr-already-logged-in {
    max-width: 380px;
    margin: 32px auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.ccr-already-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(214,17,30,.35), transparent 70%);
    filter: blur(10px);
    pointer-events: none;
}
.ccr-already-avatar {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ccr-red);
    box-shadow: 0 0 24px rgba(214,17,30,.45);
    margin-bottom: 14px;
}
.ccr-already-eyebrow {
    position: relative;
    z-index: 1;
    margin: 0 0 4px;
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ccr-gray);
}
.ccr-already-name {
    position: relative;
    z-index: 1;
    margin: 0 0 22px;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--ccr-white), var(--ccr-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ccr-already-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
}
.ccr-already-actions .ccr-btn { flex: 1; text-align: center; text-decoration: none; }

.ccr-form { display: flex; flex-direction: column; gap: 16px; }

.ccr-field { display: flex; flex-direction: column; gap: 6px; }

.ccr-field label {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: normal;
    color: var(--ccr-white);
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ccr-required {
    color: var(--ccr-red-light);
    font-weight: 800;
}

.ccr-field input,
.ccr-field textarea,
.ccr-field select {
    padding: 12px 15px;
    background: var(--ccr-dark3);
    border: 1.5px solid var(--ccr-mid);
    border-radius: 10px;
    color: var(--ccr-white);
    font-family: var(--ccr-font);
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    width: 100%;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
}
.ccr-field input:hover,
.ccr-field textarea:hover,
.ccr-field select:hover { border-color: #55555a; }
.ccr-field input:focus,
.ccr-field textarea:focus,
.ccr-field select:focus {
    border-color: var(--ccr-red);
    background: #232325;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.25), 0 0 0 3px rgba(214,17,30,.22);
}
.ccr-field input::placeholder,
.ccr-field textarea::placeholder { color: #6b6b70; }
.ccr-field input[type="file"] { background: transparent; padding: 6px 0; border: none; box-shadow: none; }
.ccr-field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.ccr-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ddc76d' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

.ccr-form-notice {
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
}

.ccr-register-login {
    text-align: center;
    font-size: 13px;
    color: var(--ccr-gray);
}
.ccr-register-login a { color: var(--ccr-gold); text-decoration: none; }
.ccr-register-login a:hover { text-decoration: underline; }

/* ============================================================
   PROFIILISIVU
   ============================================================ */

.ccr-profile-page {
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--ccr-font);
    color: var(--ccr-light);
}

/* ----- Hero-osio ----- */
.ccr-profile-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--ccr-mid);
    box-shadow: var(--ccr-shadow);
}
.ccr-profile-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% -10%, rgba(214,17,30,.35), transparent 55%),
        radial-gradient(circle at 90% 110%, rgba(221,199,109,.18), transparent 55%),
        linear-gradient(160deg, var(--ccr-dark2) 0%, var(--ccr-black) 100%);
    z-index: 0;
}

.ccr-profile-header {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 26px;
    align-items: flex-start;
    padding: 30px 28px;
}

.ccr-profile-avatar-wrap { flex-shrink: 0; position: relative; }

.ccr-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ccr-red);
    display: block;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.ccr-profile-avatar-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--ccr-gold);
    animation: ccrPulseRing 2.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ccrPulseRing {
    0%, 100% { opacity: .55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.ccr-profile-info { flex: 1; }

.ccr-profile-name {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    color: var(--ccr-white);
    letter-spacing: -0.01em;
}

.ccr-role-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.ccr-role-sheriff { background: var(--ccr-gold); color: var(--ccr-black); }
.ccr-role-user    { background: var(--ccr-mid);  color: var(--ccr-light); }

.ccr-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.ccr-meta-item {
    font-size: 13px;
    color: var(--ccr-gray);
}
.ccr-meta-item a { color: var(--ccr-gold); text-decoration: none; }
.ccr-meta-item a:hover { text-decoration: underline; }

/* ----- Tykkää / ei tykkää -painikkeet ----- */
.ccr-profile-vote {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.ccr-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    color: var(--ccr-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.ccr-vote-btn:hover { border-color: var(--ccr-red); }
.ccr-vote-like.is-active { background: rgba(40,167,69,.18); border-color: #28a745; color: #9ee89e; }
.ccr-vote-dislike.is-active { background: rgba(214,17,30,.18); border-color: var(--ccr-red); color: var(--ccr-red-light); }
.ccr-vote-count { font-weight: 700; }
.ccr-vote-static { font-size: 13px; color: var(--ccr-gray); margin-right: 12px; }

/* ----- Tilastokortit ----- */
.ccr-profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.ccr-stat-card {
    background: var(--ccr-dark2);
    border: 1px solid var(--ccr-mid);
    border-radius: 12px;
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    transition: border-color 0.15s, transform 0.15s;
}
.ccr-stat-card:hover { border-color: var(--ccr-red); transform: translateY(-2px); }
.ccr-stat-card-sheriff { border-color: rgba(221,199,109,.35); }
.ccr-stat-card-sheriff:hover { border-color: var(--ccr-gold); }
.ccr-stat-card-streak {
    border-color: rgba(255,140,0,.5);
    background: linear-gradient(160deg, rgba(255,140,0,.10), var(--ccr-dark2) 70%);
}
.ccr-stat-card-streak:hover { border-color: #ff8c00; }
.ccr-stat-card-streak .ccr-stat-icon { filter: drop-shadow(0 0 6px rgba(255,140,0,.7)); }
.ccr-stat-sublabel { font-size: 9.5px; color: var(--ccr-gray); margin-top: 1px; }
.ccr-stat-icon { font-size: 22px; }
.ccr-stat-value { font-size: 20px; font-weight: 800; color: var(--ccr-white); }
.ccr-stat-label { font-size: 11px; color: var(--ccr-gray); text-transform: uppercase; letter-spacing: .03em; }

.ccr-profile-description,
.ccr-profile-edit {
    background: var(--ccr-dark2);
    border: 1px solid var(--ccr-mid);
    border-radius: var(--ccr-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}

/* ----- Profiilin työkalupalkki: Jaa / Ilmoita ----- */
.ccr-profile-toolbar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.ccr-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    color: var(--ccr-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.ccr-icon-btn:hover { border-color: var(--ccr-gold); color: var(--ccr-gold); }
.ccr-icon-btn-danger:hover { border-color: var(--ccr-red); color: var(--ccr-red-light); }

/* ----- Välilehdet ----- */
.ccr-profile-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--ccr-mid);
}
.ccr-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ccr-gray);
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 6px 12px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.ccr-tab-btn:hover { color: var(--ccr-light); }
.ccr-tab-btn.is-active { color: var(--ccr-white); border-color: var(--ccr-red); }

.ccr-tab-panel { display: none; }
.ccr-tab-panel.is-active { display: block; }

/* ----- Tietosuojapaneeli ----- */
.ccr-profile-privacy {
    background: var(--ccr-dark2);
    border: 1px solid var(--ccr-mid);
    border-radius: var(--ccr-radius);
    padding: 22px 24px;
    margin-bottom: 16px;
}
.ccr-profile-privacy h3 { margin: 0 0 6px; color: var(--ccr-white); font-size: 17px; }
.ccr-privacy-intro { color: var(--ccr-gray); font-size: 13px; margin: 0 0 18px; }

.ccr-privacy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--ccr-mid);
}
.ccr-privacy-row:first-of-type { border-top: none; }
.ccr-privacy-row-text strong { display: block; color: var(--ccr-white); font-size: 13.5px; margin-bottom: 3px; }
.ccr-privacy-row-text p { margin: 0; font-size: 12.5px; color: var(--ccr-gray); line-height: 1.5; }
.ccr-privacy-row .ccr-btn { flex-shrink: 0; white-space: nowrap; }
.ccr-privacy-row-danger { border-top: 1px solid rgba(214,17,30,.3); }
.ccr-privacy-row-danger .ccr-privacy-row-text strong { color: var(--ccr-red-light); }

.ccr-btn-warn {
    background: #6b4a00;
    border-color: #8a6200;
    color: #ffd98a;
}
.ccr-btn-warn:hover { background: #8a6200; }

.ccr-btn-danger {
    background: var(--ccr-red);
    border-color: var(--ccr-red-dark);
    color: var(--ccr-white);
}
.ccr-btn-danger:hover:not(:disabled) { background: var(--ccr-red-dark); }
.ccr-btn-danger:disabled { opacity: .5; cursor: not-allowed; }

.ccr-modal-body-form { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.ccr-modal-body-form input[type="text"],
.ccr-report-reason {
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    color: var(--ccr-white);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: var(--ccr-font);
    resize: vertical;
}
.ccr-modal-body-form input[type="text"]:focus,
.ccr-report-reason:focus { outline: none; border-color: var(--ccr-red); }
#ccr-report-profile-notice, #ccr-privacy-notice { font-size: 12.5px; margin-top: 4px; }
.ccr-profile-description h3,
.ccr-profile-edit h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--ccr-gold);
    border-bottom: 1px solid var(--ccr-mid);
    padding-bottom: 6px;
}
.ccr-profile-description p {
    margin: 0;
    line-height: 1.6;
    color: var(--ccr-light);
}

#ccr-profile-form { display: flex; flex-direction: column; gap: 14px; }

#ccr-profile-notice {
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
}

/* ============================================================
   RESPONSIIVISUUS
   ============================================================ */

@media (max-width: 768px) {
    :root { --ccr-chat-h: 480px; --ccr-sidebar-w: 160px; }

    .ccr-chat-body { flex-direction: column; height: auto; }

    .ccr-chat-main { border-right: none; border-bottom: 1px solid var(--ccr-mid); order: 1; }

    .ccr-messages { height: 320px; }

    .ccr-sidebar-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--ccr-mid);
        max-height: 220px;
        order: 2;
    }

    .ccr-sidebar {
        width: 100%;
        max-height: 160px;
        flex-direction: row;
        overflow: hidden;
        order: 3;
    }
    .ccr-sidebar > .ccr-sidebar-section .ccr-sidebar-header { display: none; }
    .ccr-user-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px;
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .ccr-user-link { padding: 4px 8px; font-size: 12px; }

    .ccr-modal { width: 94%; }
    .ccr-modal-room { width: 96%; height: 88vh; max-height: none; }
    .ccr-modal-room .ccr-chat-body { flex-direction: column; }
    .ccr-modal-room .ccr-sidebar { max-height: 140px; }
    .ccr-modal-room .ccr-sidebar-left { max-height: 180px; }

    .ccr-profile-header { flex-direction: column; align-items: center; text-align: center; }
    .ccr-profile-meta { align-items: center; }
    .ccr-profile-vote { justify-content: center; }
    .ccr-profile-stats-grid { grid-template-columns: repeat(2, 1fr); }

    .ccr-rooms-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    :root { --ccr-chat-h: 400px; }
    .ccr-messages { height: 260px; }
    .ccr-room-title { font-size: 16px; }
    .ccr-chat-header { padding: 10px 12px; }
    .ccr-btn { padding: 7px 12px; font-size: 13px; }
}

/* ============================================================
   TIETOSUOJASELOSTE ([chat_privacy_policy]) - haitarimalli
   ============================================================ */

.ccr-info-page,
.ccr-privacy-policy {
    max-width: 720px;
    margin: 32px auto;
    padding: 34px 36px;
    font-family: var(--ccr-font);
    color: var(--ccr-light);
}

.ccr-info-page-header,
.ccr-privacy-policy-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ccr-mid);
}
.ccr-info-page-header h2,
.ccr-privacy-policy-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--ccr-white), var(--ccr-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ccr-info-page-sub,
.ccr-privacy-policy-sub {
    margin: 0;
    font-size: 13px;
    color: var(--ccr-gray);
}

.ccr-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ccr-accordion-item {
    background: var(--ccr-dark2);
    border: 1px solid var(--ccr-mid);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.ccr-accordion-item.is-open { border-color: var(--ccr-red); }

.ccr-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--ccr-white);
    font-family: var(--ccr-font);
    font-size: 14.5px;
    font-weight: 700;
    text-align: left;
    padding: 16px 20px;
    cursor: pointer;
}
.ccr-accordion-header:hover { color: var(--ccr-gold); }

.ccr-accordion-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    border-radius: 50%;
    font-size: 15px;
    color: var(--ccr-red-light);
    transition: transform 0.2s, background 0.2s, color 0.2s;
}
.ccr-accordion-item.is-open .ccr-accordion-icon {
    background: var(--ccr-red);
    color: var(--ccr-white);
    border-color: var(--ccr-red-dark);
}

.ccr-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.ccr-accordion-body-inner {
    padding: 0 20px 18px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--ccr-light);
}
.ccr-accordion-body-inner p { margin: 0 0 12px; }
.ccr-accordion-body-inner p:last-child { margin-bottom: 0; }
.ccr-accordion-body-inner a { color: var(--ccr-gold); text-decoration: none; }
.ccr-accordion-body-inner a:hover { text-decoration: underline; }
.ccr-accordion-body-inner strong { color: var(--ccr-white); }

.ccr-privacy-list {
    margin: 0 0 12px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ccr-privacy-list li { padding-left: 4px; }
.ccr-privacy-list li::marker { color: var(--ccr-red-light); }

@media (max-width: 600px) {
    .ccr-info-page,
    .ccr-privacy-policy { padding: 24px 18px; }
    .ccr-accordion-header { padding: 14px 16px; font-size: 13.5px; }
    .ccr-accordion-body-inner { padding: 0 16px 16px; }
}

/* ============================================================
   YKSITYISVIESTIT (DM)
   ============================================================ */

/* ----- Sidebar: Viestit-osio ----- */
.ccr-conversation-list {
    list-style: none !important;
    margin: 0;
    padding: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.ccr-conversation-item { list-style: none !important; margin-bottom: 2px; }
.ccr-conversation-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.12s;
}
.ccr-conversation-link:hover { background: var(--ccr-red); }
.ccr-conversation-link:hover .ccr-conversation-name,
.ccr-conversation-link:hover .ccr-conversation-preview { color: var(--ccr-white); }
.ccr-conversation-avatar {
    width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
    border: 1px solid var(--ccr-mid); flex-shrink: 0;
}
.ccr-conversation-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ccr-conversation-name { font-size: 12.5px; font-weight: 700; color: var(--ccr-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccr-conversation-preview { font-size: 11px; color: var(--ccr-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccr-conversation-item.has-unread .ccr-conversation-name { color: var(--ccr-white); }
.ccr-conversation-badge {
    flex-shrink: 0;
    background: var(--ccr-red);
    color: var(--ccr-white);
    font-size: 10.5px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.ccr-conversation-empty { font-size: 12px; color: var(--ccr-gray); font-style: italic; padding: 6px 10px; }

/* ----- Käyttäjälistan "Viesti"-painike ----- */
.ccr-dm-btn {
    background: rgba(214,17,30,.12);
    border-color: rgba(214,17,30,.4);
    color: var(--ccr-red-light);
}
.ccr-dm-btn:hover { background: var(--ccr-red); color: var(--ccr-white); }

/* ----- DM-modaali ----- */
.ccr-modal-dm {
    max-width: 460px;
    height: 60vh;
    max-height: 560px;
    display: flex;
    flex-direction: column;
    border-color: var(--ccr-red-dark);
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(214,17,30,.25);
}

.ccr-dm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ccr-mid);
    background: linear-gradient(90deg, rgba(214,17,30,.15), transparent);
    flex-shrink: 0;
}
.ccr-dm-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ccr-red); flex-shrink: 0; }
.ccr-dm-header-text { flex: 1; min-width: 0; }
.ccr-dm-header-text h3 { margin: 0; font-size: 15px; color: var(--ccr-white); }
.ccr-dm-lock { font-size: 10.5px; color: var(--ccr-red-light); display: block; margin-top: 2px; }
.ccr-dm-header .ccr-icon-btn { padding: 5px 9px; font-size: 13px; }
.ccr-dm-header .ccr-modal-close { flex-shrink: 0; }

.ccr-dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccr-dm-msg { display: flex; flex-direction: column; max-width: 78%; }
.ccr-dm-msg-own { align-self: flex-end; align-items: flex-end; }
.ccr-dm-msg-other { align-self: flex-start; align-items: flex-start; }

.ccr-dm-bubble {
    padding: 8px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}
.ccr-dm-msg-own .ccr-dm-bubble {
    background: var(--ccr-red);
    color: var(--ccr-white);
    border-bottom-right-radius: 4px;
}
.ccr-dm-msg-other .ccr-dm-bubble {
    background: var(--ccr-dark3);
    color: var(--ccr-light);
    border: 1px solid var(--ccr-mid);
    border-bottom-left-radius: 4px;
}
.ccr-dm-time { font-size: 10px; color: var(--ccr-gray); margin-top: 3px; padding: 0 4px; }

.ccr-dm-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--ccr-mid);
    flex-shrink: 0;
}
.ccr-dm-input-row .ccr-message-input { flex: 1; }

@media (max-width: 600px) {
    .ccr-modal-dm { height: 80vh; max-height: none; width: 96%; }
}

/* ============================================================
   PROFIILIKUVAN LATAUS (dropzone)
   ============================================================ */

.ccr-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--ccr-dark3);
    border: 2px dashed var(--ccr-mid);
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
}
.ccr-avatar-upload.is-dragover {
    border-color: var(--ccr-red);
    background: rgba(214,17,30,.08);
}

.ccr-avatar-upload-preview {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--ccr-mid);
    cursor: pointer;
    transition: border-color 0.2s;
}
.ccr-avatar-upload-preview:hover { border-color: var(--ccr-red); }
.ccr-avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ccr-avatar-upload-info { flex: 1; min-width: 0; }
.ccr-avatar-upload-hint {
    margin: 8px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--ccr-gray);
}
.ccr-avatar-upload-filename {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--ccr-gold);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .ccr-avatar-upload { flex-direction: column; text-align: center; }
}

.ccr-recaptcha-wrap { margin: 4px 0; }

/* ============================================================
   TILIVALIKKO ([chat_account_menu]) - kompakti kirjautumistila-widgetti
   ============================================================ */

.ccr-account-menu {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ccr-font);
}
.ccr-account-menu-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ccr-white);
    font-size: 13.5px;
    font-weight: 600;
    background: var(--ccr-dark3);
    border: 1px solid var(--ccr-mid);
    padding: 5px 12px 5px 5px;
    border-radius: 20px;
    transition: border-color 0.15s;
}
.ccr-account-menu-profile:hover { border-color: var(--ccr-gold); }
.ccr-account-menu-profile img { border-radius: 50%; object-fit: cover; }
.ccr-account-menu-logout {
    font-size: 12.5px;
    color: var(--ccr-gray);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 20px;
    transition: color 0.15s, background 0.15s;
}
.ccr-account-menu-logout:hover { color: var(--ccr-white); background: var(--ccr-red); }
.ccr-account-menu-guest { gap: 8px; }
.ccr-account-menu-login,
.ccr-account-menu-register {
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.15s;
}
.ccr-account-menu-login { color: var(--ccr-light); border: 1px solid var(--ccr-mid); }
.ccr-account-menu-login:hover { border-color: var(--ccr-white); color: var(--ccr-white); }
.ccr-account-menu-register { background: var(--ccr-red); color: var(--ccr-white); }
.ccr-account-menu-register:hover { background: var(--ccr-red-dark); }

/* ============================================================
   HUONEEN SUMENNUS KIRJAUTUMATTOMILLE (teaser-efekti)
   ============================================================ */

.ccr-guest-blur-wrap {
    position: relative;
    overflow: hidden;
    min-height: 420px;
}

.ccr-guest-blur-content {
    filter: blur(7px) brightness(0.6);
    pointer-events: none;
    user-select: none;
    transform: scale(1.02); /* peittää blurin reunavuodon */
}

.ccr-fake-body { display: flex; height: 420px; }
.ccr-fake-sidebar {
    width: var(--ccr-sidebar-w);
    background: var(--ccr-dark2);
    padding: 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ccr-fake-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--ccr-dark3), var(--ccr-mid), var(--ccr-dark3));
}
.ccr-fake-line-short { width: 60%; }
.ccr-fake-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}
.ccr-fake-msg {
    height: 34px;
    width: 55%;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--ccr-dark3), var(--ccr-mid), var(--ccr-dark3));
}
.ccr-fake-msg-left { align-self: flex-start; }
.ccr-fake-msg-right { align-self: flex-end; background: linear-gradient(90deg, var(--ccr-red-dark), var(--ccr-red), var(--ccr-red-dark)); }
.ccr-fake-msg.short { width: 30%; }

.ccr-guest-blur-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0,0,0,.35), rgba(0,0,0,.65));
    padding: 20px;
}

.ccr-guest-blur-card {
    background: linear-gradient(165deg, var(--ccr-dark2) 0%, var(--ccr-black) 100%);
    border: 1px solid var(--ccr-mid);
    border-radius: 16px;
    padding: 32px 36px;
    text-align: center;
    max-width: 340px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.ccr-guest-blur-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--ccr-white);
}
.ccr-guest-blur-card p {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--ccr-gray);
}
.ccr-guest-blur-card .ccr-already-actions { display: flex; gap: 10px; }
.ccr-guest-blur-card .ccr-btn { flex: 1; text-align: center; text-decoration: none; }

.ccr-msg-image-link { display: block; margin-top: 6px; }
.ccr-msg-image {
    max-width: 240px;
    max-height: 240px;
    border-radius: 10px;
    border: 1px solid var(--ccr-mid);
    display: block;
    object-fit: cover;
    transition: opacity 0.15s;
}
.ccr-msg-image:hover { opacity: 0.9; }
.ccr-image-share-btn { flex-shrink: 0; padding: 9px 12px; font-size: 15px; }

/* ============================================================
   YKSITYINEN/JULKINEN-VALINTA HUONEEN VIESTIKENTÄSSÄ
   ============================================================ */

.ccr-privacy-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 0;
    flex-wrap: wrap;
}
.ccr-privacy-toggle-label {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--ccr-gray);
    cursor: pointer;
}
.ccr-privacy-toggle-label input:checked ~ span,
.ccr-privacy-toggle-row input.ccr-private-toggle:checked + span { color: var(--ccr-red-light); font-weight: 700; }
.ccr-private-target {
    flex: 1;
    min-width: 140px;
    max-width: 220px;
    padding: 6px 30px 6px 10px;
    font-size: 12.5px;
    background: var(--ccr-dark3);
    border: 1.5px solid var(--ccr-red);
    border-radius: 8px;
    color: var(--ccr-white);
}

/* ============================================================
   HUONELISTAUKSEN "PORTTI" KIRJAUTUMATTOMILLE
   ============================================================ */

.ccr-rooms-gate {
    max-width: 900px;
    margin: 0 auto;
    font-family: var(--ccr-font);
}
.ccr-rooms-gate-intro {
    text-align: center;
    margin-bottom: 28px;
}
.ccr-rooms-gate-intro h2 {
    font-size: 22px;
    color: var(--ccr-white);
    margin: 0 0 8px;
}
.ccr-rooms-gate-intro p {
    color: var(--ccr-gray);
    font-size: 13.5px;
    margin: 0;
}
.ccr-rooms-gate-columns {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.ccr-rooms-gate-col { flex: 1; min-width: 0; }
.ccr-rooms-gate-col .ccr-register-wrap,
.ccr-rooms-gate-col .ccr-already-logged-in { margin: 0; }

@media (max-width: 720px) {
    .ccr-rooms-gate-columns { flex-direction: column; }
}

/* ============================================================
   KÄYTTÄJÄN TILA: KUUNTELEN / KATSON
   ============================================================ */

.ccr-user-name-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.ccr-user-status {
    display: block;
    font-size: 10.5px;
    color: var(--ccr-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.ccr-meta-listening,
.ccr-meta-watching { color: var(--ccr-light); }
