/* Chat: Mode Dunia. Pasangan dari chat/world.php + assets/js/chat-world.js */
:root {
    --cw-ink: #1b1d2a;
    --cw-panel: #262a3d;
    --cw-panel-2: #2f3450;
    --cw-line: #3d4366;
    --cw-text: #eef0ff;
    --cw-muted: #a3a9cc;
    --cw-accent: #7c86ff;
    --cw-accent-2: #5865f2;
    --cw-good: #34d399;
    --cw-warn: #fbbf24;
    --cw-bad: #f43f5e;
    --cw-cream: #fff7e6;
    --cw-shadow: 0 4px 0 rgba(0, 0, 0, .35);
    --cw-radius: 14px;
    --cw-chat-w: 380px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--cw-ink);
    color: var(--cw-text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#cw-app { position: fixed; inset: 0; }
#cw-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: pointer;
    image-rendering: pixelated;
}

/* ── HUD ─────────────────────────────────────────────────────────────── */
.cw-hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 12px 0;
    pointer-events: none;
    z-index: 5;
}
.cw-hud > * { pointer-events: auto; }
.cw-hud-left, .cw-hud-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cw-place {
    background: rgba(27, 29, 42, .82);
    border: 2px solid var(--cw-line);
    border-radius: var(--cw-radius);
    padding: 6px 12px 7px;
    box-shadow: var(--cw-shadow);
    min-width: 0;
    backdrop-filter: blur(6px);
}
.cw-place-kicker {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cw-muted);
    font-weight: 600;
}
.cw-place-name {
    font-family: "Pixelify Sans", Inter, sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

.cw-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 2px solid var(--cw-line);
    background: var(--cw-panel);
    color: var(--cw-text);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--cw-shadow);
    transition: transform .08s ease, background .15s ease;
    white-space: nowrap;
}
.cw-btn:hover { background: var(--cw-panel-2); }
.cw-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.cw-btn-icon { width: 38px; padding: 0; justify-content: center; }
.cw-btn-primary { background: var(--cw-accent-2); border-color: #8b93ff; }
.cw-btn-primary:hover { background: #4e5ae6; }
.cw-btn canvas { width: 24px; height: 24px; image-rendering: pixelated; margin: 0 -2px; }
.cw-dot-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--cw-bad);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--cw-ink);
}

.cw-exit {
    position: absolute;
    left: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 2px solid #b45309;
    background: #f59e0b;
    color: #2b1600;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: var(--cw-shadow);
}
.cw-exit:active { transform: translateY(2px); }

.cw-recenter {
    position: absolute;
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 2px solid #3b2a12;
    background: #ffd166;
    color: #3b2a12;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: var(--cw-shadow);
}
.cw-recenter:active { transform: translateY(2px); }
.cw-pray-btn { margin-top: 12px; width: 100%; justify-content: center; background: #2e8b57; border-color: #7cc6a1; }
.cw-pray-btn:hover { background: #26734a; }
@media (max-width: 760px) { .cw-recenter { top: 64px; bottom: auto; } }

.cw-toast {
    position: absolute;
    left: 50%;
    top: 74px;
    transform: translate(-50%, -8px);
    z-index: 6;
    background: var(--cw-cream);
    color: #3b2a12;
    border: 2px solid #3b2a12;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--cw-shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.cw-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Panel chat ──────────────────────────────────────────────────────── */
.cw-chat {
    position: absolute;
    top: 64px;
    right: 12px;
    bottom: 12px;
    width: var(--cw-chat-w);
    z-index: 4;
    display: flex;
    flex-direction: column;
    background: rgba(30, 33, 50, .96);
    border: 2px solid var(--cw-line);
    border-radius: 18px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 20px 50px rgba(0, 0, 0, .35);
    overflow: hidden;
    animation: cw-pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes cw-pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
.cw-chat-head {
    position: relative;
    padding: 10px 44px 10px 14px;
    background: var(--cw-panel-2);
    border-bottom: 2px solid var(--cw-line);
}
.cw-chat-grip { display: none; }
.cw-chat-title {
    font-family: "Pixelify Sans", Inter, sans-serif;
    font-weight: 700;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.cw-chat-title > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-chat-hash { color: var(--cw-accent); }
.cw-chat-online {
    margin-left: auto;
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-good);
    white-space: nowrap;
}
.cw-chat-desc {
    font-size: 12px;
    color: var(--cw-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cw-chat-desc:empty { display: none; }
.cw-chat-min {
    position: absolute;
    top: 10px; right: 10px;
    width: 28px; height: 28px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--cw-muted);
    display: grid;
    place-items: center;
}
.cw-chat-min:hover { background: rgba(255, 255, 255, .08); color: var(--cw-text); }

.cw-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--cw-line) transparent;
}
.cw-chat-more { text-align: center; margin-bottom: 8px; }
.cw-chat-more button {
    border: 1px solid var(--cw-line);
    background: transparent;
    color: var(--cw-muted);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
}
.cw-empty {
    text-align: center;
    color: var(--cw-muted);
    font-size: 13px;
    padding: 30px 10px;
}
.cw-empty b { display: block; color: var(--cw-text); font-family: "Pixelify Sans", Inter, sans-serif; font-size: 16px; margin-bottom: 4px; }

.cw-msg { display: flex; gap: 9px; padding: 5px 0; }
.cw-msg.cont { padding-top: 0; }
.cw-msg.cont .cw-msg-av { visibility: hidden; height: 0; }
.cw-msg.cont .cw-msg-meta { display: none; }
.cw-msg-av {
    flex: 0 0 32px;
    width: 32px; height: 32px;
    border-radius: 10px;
    background: var(--cw-panel-2);
    image-rendering: pixelated;
}
.cw-msg-main { min-width: 0; flex: 1; }
.cw-msg-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 1px; }
.cw-msg-name { font-weight: 700; font-size: 13px; }
.cw-msg-time { font-size: 11px; color: var(--cw-muted); }
.cw-msg-text {
    font-size: 14px;
    line-height: 1.45;
    color: #dfe2f7;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.cw-msg-text a { color: #9fb0ff; }
.cw-msg-text img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
    margin-top: 4px;
    cursor: zoom-in;
}
/* Kartu video YouTube / Google Drive */
.cw-video {
    position: relative;
    margin-top: 6px;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, .08);
    cursor: pointer;
    white-space: normal;
}
.cw-msg-text .cw-video img { width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; object-fit: cover; cursor: pointer; }
.cw-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.cw-video-gd { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9aa3c7; font-size: 13px; }
.cw-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .22);
    transition: background .15s;
}
.cw-video:hover .cw-video-play { background: rgba(0, 0, 0, .05); }
.cw-video-play span {
    width: 52px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, .94);
    box-shadow: 0 3px 0 rgba(120, 20, 20, .6);
    position: relative;
}
.cw-video-play span::after {
    content: '';
    position: absolute;
    left: 21px;
    top: 10px;
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #fff;
}
.cw-video-label {
    position: absolute;
    left: 8px;
    bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, .6);
    padding: 2px 8px;
    border-radius: 6px;
}
.cw-video:focus-visible { outline: 2px solid #9fb0ff; outline-offset: 2px; }
.cw-msg-text .cw-mention { background: rgba(124, 134, 255, .22); color: #c7ccff; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cw-msg-text .cw-mention.me { background: rgba(255, 209, 102, .28); color: #ffd166; }
.cw-msg.deleted .cw-msg-text { color: var(--cw-muted); font-style: italic; }
.cw-msg-reply {
    font-size: 12px;
    color: var(--cw-muted);
    border-left: 3px solid var(--cw-line);
    padding-left: 7px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cw-msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.cw-msg-reacts span {
    font-size: 12px;
    background: var(--cw-panel-2);
    border: 1px solid var(--cw-line);
    border-radius: 999px;
    padding: 0 7px;
}
.cw-msg.mine .cw-msg-name { color: #a9b1ff; }

/* Bubble pesan (ruang, space, DM): pesan sendiri kanan berwarna aksen, pesan orang lain kiri netral. Satu renderer (msgHTML), jadi CSS saja. */
.cw-msg-main { display: flex; flex-direction: column; align-items: flex-start; }
.cw-msg-text {
    background: var(--cw-panel-2);
    border-radius: 14px;
    border-top-left-radius: 4px;
    padding: 8px 12px;
    max-width: 80%;
    width: fit-content;
    box-sizing: border-box;
}
.cw-msg.cont .cw-msg-text { border-top-left-radius: 14px; }
.cw-msg:has(+ .cw-msg.cont:not(.mine)) .cw-msg-text { border-bottom-left-radius: 4px; }
.cw-msg-reply { max-width: 80%; box-sizing: border-box; }
.cw-msg.mine { flex-direction: row-reverse; }
.cw-msg.mine .cw-msg-av { display: none; }
.cw-msg.mine .cw-msg-main { align-items: flex-end; }
.cw-msg.mine .cw-msg-meta { flex-direction: row-reverse; }
.cw-msg.mine .cw-msg-text {
    background: #4a56e0;
    color: #fff;
    border-top-left-radius: 14px;
    border-top-right-radius: 4px;
}
.cw-msg.mine.cont .cw-msg-text { border-top-right-radius: 14px; }
.cw-msg.mine:has(+ .cw-msg.cont.mine) .cw-msg-text { border-bottom-right-radius: 4px; }
.cw-msg.mine .cw-msg-text a { color: #fff; text-decoration: underline; }
.cw-msg.mine .cw-msg-text .cw-mention, .cw-msg.mine .cw-msg-text .cw-mention.me { background: rgba(255, 255, 255, .25); color: #fff; }
.cw-msg.mine .cw-msg-reply { border-left: 0; border-right: 3px solid var(--cw-line); padding-left: 0; padding-right: 7px; text-align: right; }
.cw-msg.mine .cw-msg-reacts { justify-content: flex-end; }
.cw-msg.deleted .cw-msg-text, .cw-msg.mine.deleted .cw-msg-text { background: transparent; border: 1px dashed var(--cw-line); color: var(--cw-muted); }
.cw-msg-text img, .cw-msg-text .cw-video { max-width: 100%; }
.cw-day {
    text-align: center;
    font-size: 11px;
    color: var(--cw-muted);
    margin: 10px 0 6px;
    font-weight: 600;
}

.cw-typing {
    min-height: 18px;
    padding: 0 14px;
    font-size: 11.5px;
    color: var(--cw-muted);
    font-style: italic;
}
/* Tag orang: daftar nama di atas kotak ketik */
.cw-mention-dd { margin: 0 10px 6px; padding: 4px; border-radius: 12px; background: #1b1d2a; border: 1px solid rgba(159, 176, 255, .35); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.cw-mention-dd[hidden] { display: none; }
.cw-mention-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: #dfe2f7; font-size: 13.5px; text-align: left; cursor: pointer; }
.cw-mention-item.on, .cw-mention-item:hover { background: rgba(124, 134, 255, .22); color: #fff; }
.cw-mention-av { flex: 0 0 24px; height: 24px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #3b4270; color: #c7ccff; font-size: 11px; font-weight: 700; }
.cw-mention-av img { width: 100%; height: 100%; object-fit: cover; }
.cw-chat.dm .cw-mention-dd { background: #fffaf0; border-color: #e3c9a0; }
.cw-chat.dm .cw-mention-item { color: #2b2116; }
.cw-chat.dm .cw-mention-item.on, .cw-chat.dm .cw-mention-item:hover { background: #ffe9b3; color: #2b2116; }
.cw-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 4px 10px max(10px, env(safe-area-inset-bottom));
}
.cw-composer textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 130px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 2px solid var(--cw-line);
    background: #1b1e2e;
    outline: none;
    font-size: 14px;
    line-height: 1.35;
}
.cw-composer textarea:focus { border-color: var(--cw-accent); }
.cw-composer button {
    flex: 0 0 42px;
    height: 42px;
    border-radius: 12px;
    border: 2px solid #8b93ff;
    background: var(--cw-accent-2);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.cw-composer button.cw-attach-btn { background: #2a2f47; border-color: var(--cw-line); box-shadow: none; }
.cw-chat.dm .cw-composer button.cw-attach-btn { background: #fff; border-color: #e3c9a0; color: #d9466f; }
.cw-attach-prev {
    position: relative;
    margin: 4px 10px 0;
    padding: 6px;
    width: max-content;
    max-width: calc(100% - 20px);
    border-radius: 10px;
    border: 2px solid var(--cw-line);
    background: rgba(0, 0, 0, .18);
}
.cw-attach-prev[hidden] { display: none; }
.cw-attach-prev img { display: block; max-width: 100%; max-height: 110px; border-radius: 6px; }
.cw-attach-prev button {
    position: absolute; top: -9px; right: -9px;
    width: 22px; height: 22px; padding: 0;
    border-radius: 50%; border: 2px solid #fff;
    background: #d9466f; color: #fff;
    font-size: 14px; line-height: 1; cursor: pointer;
}
.cw-chat.min .cw-attach-prev { display: none; }
.cw-composer button:disabled { opacity: .5; cursor: default; }
.cw-composer button:active { transform: translateY(2px); box-shadow: none; }

/* ── Obrolan DM di tempat (gaya Sky): bilah kecil di bawah tengah ────── */
.cw-chat-close {
    display: none;
    position: absolute;
    top: 10px; right: 42px;
    width: 28px; height: 28px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--cw-muted);
    cursor: pointer;
    place-items: center;
}
.cw-chat-close:hover { background: rgba(255, 255, 255, .08); color: var(--cw-text); }
.cw-chat.dm .cw-chat-close { display: grid; }
.cw-chat.dm {
    top: auto;
    left: 50%;
    right: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(460px, calc(100vw - 24px));
    height: var(--cw-dm-h, 300px);
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    transform: translateX(-50%);
    background: rgba(255, 247, 236, .97);
    border-color: #2b2116;
    color: #2b2116;
    animation: cw-dm-in .22s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes cw-dm-in { from { transform: translate(-50%, 24px); opacity: 0; } }
.cw-chat.dm.min { height: auto; }
.cw-chat.dm .cw-chat-head { background: #ffe8c7; border-bottom-color: #e8cfa8; padding-right: 76px; }
.cw-chat.dm .cw-chat-hash { color: #d9466f; }
.cw-chat.dm .cw-chat-desc, .cw-chat.dm .cw-msg-time, .cw-chat.dm .cw-typing, .cw-chat.dm .cw-day { color: #8a7458; }
.cw-chat.dm .cw-chat-min, .cw-chat.dm .cw-chat-close { color: #8a7458; }
.cw-chat.dm .cw-msg-text { color: #2b2116; }
.cw-chat.dm .cw-msg.mine .cw-msg-name { color: #d9466f; }
.cw-chat.dm .cw-msg-text { background: #fff; border: 1px solid #e8cfa8; }
.cw-chat.dm .cw-msg.mine .cw-msg-text { background: #c93a62; border-color: #c93a62; color: #fff; }
.cw-chat.dm .cw-msg.mine .cw-msg-text a { color: #fff; }
.cw-chat.dm .cw-msg.deleted .cw-msg-text, .cw-chat.dm .cw-msg.mine.deleted .cw-msg-text { background: transparent; border: 1px dashed #d9bd93; color: #6b5a44; }
.cw-chat.dm .cw-empty, .cw-chat.dm .cw-empty b { color: #6b5a44; }
.cw-chat.dm .cw-composer textarea { background: #fff; border-color: #e3c9a0; color: #2b2116; }
.cw-chat.dm .cw-composer textarea:focus { border-color: #d9466f; }
.cw-chat.dm .cw-composer button { background: #d9466f; border-color: #f07a9b; }
@media (max-width: 760px) {
    .cw-chat.dm { width: auto; left: 0; right: 0; transform: none; height: 44vh; height: var(--cw-dm-h, 44dvh); border-radius: 20px 20px 0 0; animation: cw-sheet .25s cubic-bezier(.2, 1.2, .4, 1); }
    .cw-chat.dm.min { height: auto; }
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.cw-modal {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(10, 11, 20, .55);
    display: grid;
    place-items: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}
.cw-modal-card {
    width: min(520px, 100%);
    max-height: min(640px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    background: var(--cw-panel);
    border: 2px solid var(--cw-line);
    border-radius: 18px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
    overflow: hidden;
    animation: cw-pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
.cw-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 2px solid var(--cw-line);
    background: var(--cw-panel-2);
}
.cw-modal-head h2 { margin: 0; font-family: "Pixelify Sans", Inter, sans-serif; font-size: 19px; }
.cw-modal-x {
    width: 32px; height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--cw-muted);
}
.cw-modal-x:hover { background: rgba(255, 255, 255, .08); color: var(--cw-text); }
.cw-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 2px solid var(--cw-line); }

.cw-search {
    margin: 12px 14px 6px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 2px solid var(--cw-line);
    background: #1b1e2e;
    outline: none;
}
.cw-search:focus { border-color: var(--cw-accent); }
.cw-map-list { overflow-y: auto; padding: 6px 8px 12px; }
.cw-map-group {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cw-muted);
    font-weight: 700;
    padding: 10px 8px 4px;
}
.cw-map-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.cw-map-item:hover { background: var(--cw-panel-2); }
.cw-map-item.locked { opacity: .72; }
.cw-map-item.locked .cw-map-ico { filter: grayscale(.45); }
.cw-map-item.locked .cw-map-sub { color: #b8b0cc; }
.cw-map-ico {
    flex: 0 0 34px;
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 17px;
    border: 2px solid rgba(0, 0, 0, .25);
    overflow: hidden;
}
.cw-map-ico img { width: 100%; height: 100%; object-fit: cover; }
.cw-map-txt { min-width: 0; flex: 1; }
.cw-map-name, .cw-map-sub { display: block; }
.cw-map-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-map-sub { font-size: 12px; color: var(--cw-muted); }
.cw-map-unread {
    background: var(--cw-bad);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
}
.cw-map-here { color: var(--cw-good); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ── NPC koordinator ─────────────────────────────────────────────────── */
.cw-npc {
    position: absolute;
    left: 12px;
    bottom: 64px;
    z-index: 8;
    width: min(380px, calc(100vw - 24px));
    max-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    background: var(--cw-cream);
    color: #2b2116;
    border: 2px solid #2b2116;
    border-radius: 18px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 20px 40px rgba(0, 0, 0, .3);
    overflow: hidden;
    animation: cw-pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
.cw-npc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 12px;
    background: #ffd166;
    border-bottom: 2px solid #2b2116;
}
.cw-npc-head canvas { width: 40px; height: 40px; border-radius: 10px; background: #fff3c4; image-rendering: pixelated; border: 2px solid #2b2116; }
.cw-npc-head > div { flex: 1; min-width: 0; }
.cw-npc-name { font-family: "Pixelify Sans", Inter, sans-serif; font-weight: 700; font-size: 18px; line-height: 1.1; }
.cw-npc-role { font-size: 12px; color: #6b5a2a; }
.cw-npc-head .cw-modal-x { color: #3b2a12; }
.cw-npc-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.cw-npc-streak {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #2b2116;
    color: #fff7e6;
}
.cw-npc-streak b { font-family: "Pixelify Sans", Inter, sans-serif; font-size: 30px; line-height: 1; color: #ffd166; }
.cw-npc-streak span { font-size: 12.5px; }
.cw-npc-streak em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; background: #f43f5e; color: #fff; border-radius: 999px; padding: 3px 9px; }
.cw-npc-streak em.ok { background: #23a55a; }
/* Sapaan harian Kak Vata */
.cw-greet { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: #fff3c4; border: 2px solid #2b2116; color: #2b2116; }
.cw-greet-hi { font-family: "Pixelify Sans", Inter, sans-serif; font-weight: 700; font-size: 19px; line-height: 1.15; }
.cw-greet p { margin: 0; font-size: 13px; line-height: 1.45; }
.cw-greet .warn { color: #c0392b; font-weight: 700; }
.cw-greet-intro { padding-bottom: 6px; border-bottom: 1px dashed rgba(43, 33, 22, .35); }
.cw-greet-lv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13px; }
.cw-greet-lv b { font-family: "Pixelify Sans", Inter, sans-serif; font-size: 16px; }
.cw-greet-lv em { margin-left: auto; font-style: normal; font-size: 11.5px; color: #6b5a2a; }
.cw-greet-lv i { flex: 1 0 100%; height: 8px; border-radius: 999px; background: rgba(43, 33, 22, .15); overflow: hidden; }
.cw-greet-lv s { display: block; height: 100%; background: linear-gradient(90deg, #34c46f, #ffd166); border-radius: 999px; text-decoration: none; }
.cw-npc-note, .cw-npc-lead { margin: 0; font-size: 13px; color: #6b5a44; line-height: 1.45; }
.cw-npc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cw-npc-list li { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.45; }
.cw-npc-ico {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 7px;
    background: #2b2116;
    color: #ffd166;
    font-weight: 700;
    font-size: 13px;
    display: grid;
    place-items: center;
}
.cw-npc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cw-npc .cw-btn { height: 30px; font-size: 12px; padding: 0 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.cw-npc .cw-btn:not(.cw-btn-primary) { background: #fff; color: #2b2116; border-color: #2b2116; }
.cw-npc-roll { align-self: flex-start; }
.cw-npc-chat { display: flex; flex-direction: column; gap: 6px; }
.cw-npc-chat:empty { display: none; }
.cw-npc-msg { font-size: 13px; line-height: 1.45; padding: 7px 10px; border-radius: 12px; max-width: 90%; white-space: pre-wrap; }
.cw-npc-msg.user { align-self: flex-end; background: #5865f2; color: #fff; }
.cw-npc-msg.assistant { align-self: flex-start; background: #fff; border: 1.5px solid #e3c9a0; white-space: normal; overflow-wrap: anywhere; }
.cw-npc-msg.assistant p { margin: 0 0 8px; }
.cw-npc-msg.assistant p:last-child, .cw-npc-msg.assistant ul:last-child, .cw-npc-msg.assistant ol:last-child { margin-bottom: 0; }
.cw-npc-msg.assistant ul, .cw-npc-msg.assistant ol { margin: 0 0 8px; padding-left: 18px; }
.cw-npc-msg.assistant li { margin: 2px 0; }
.cw-npc-msg.assistant li::marker { color: #b8891f; font-weight: 700; }
.cw-npc-msg.assistant strong { color: #2b2116; }
.cw-npc-msg.assistant a { color: #4752c4; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cw-npc-msg.thinking { color: #8a7458; }
.cw-npc-form { display: flex; gap: 6px; padding: 10px 12px 12px; border-top: 2px dashed #e3c9a0; }
.cw-npc-form input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 2px solid #e3c9a0;
    background: #fff;
    color: #2b2116;
    outline: none;
    font-size: 13.5px;
}
.cw-npc-form input:focus { border-color: #2b2116; }
.cw-npc-form button { flex: 0 0 38px; height: 38px; border-radius: 12px; border: 2px solid #2b2116; background: #ffd166; color: #2b2116; cursor: pointer; display: grid; place-items: center; }
.cw-npc.checkin .cw-npc-form { display: none; }
.cw-npc-file {
    display: block;
    padding: 12px;
    border: 2px dashed #c9a87a;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
}
.cw-npc-file input { display: none; }
.cw-ci-preview { width: 100%; max-height: 160px; object-fit: contain; border-radius: 10px; background: #fff; }
.cw-npc-body textarea {
    width: 100%;
    resize: vertical;
    padding: 9px 11px;
    border-radius: 12px;
    border: 2px solid #e3c9a0;
    background: #fff;
    color: #2b2116;
    font-size: 13.5px;
    outline: none;
}
.cw-npc-row { display: flex; justify-content: flex-end; gap: 8px; }
/* Laporan absen 3 bagian (21 Okt 2026): label kecil di atas tiap isian. */
.cw-ci-field { display: flex; flex-direction: column; gap: 4px; }
.cw-ci-field > span { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #6b5a2a; }
.cw-ci-field > span i { font-style: normal; color: #f43f5e; }
.cw-ci-field textarea { min-height: 54px; }
.cw-roll-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--cw-muted); margin: 10px 0 6px; }
@media (max-width: 760px) {
    .cw-npc { left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; border-radius: 20px 20px 0 0; border-bottom: 0; }
}

/* ── Progres: chip level di HUD + kartu progres ──────────────────────── */
.cw-lvl { gap: 8px; }
.cw-lvl #cw-lvl-num { font-family: "Pixelify Sans", Inter, sans-serif; font-size: 15px; color: #ffd166; }
.cw-lvl-bar { width: 54px; height: 8px; border-radius: 4px; background: #1b1d2a; border: 1px solid var(--cw-line); overflow: hidden; }
.cw-lvl-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd166, #34d399); }
.cw-lvl-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--cw-panel-2); border: 2px solid var(--cw-line); }
.cw-lvl-big {
    flex: 0 0 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #ffd166;
    color: #3b2a12;
    font-family: "Pixelify Sans", Inter, sans-serif;
    font-size: 30px;
    font-weight: 700;
    border: 2px solid #3b2a12;
}
.cw-lvl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cw-lvl-info b { font-size: 15px; }
.cw-lvl-info span, .cw-lvl-info small { font-size: 12px; color: var(--cw-muted); }
.cw-lvl-info small.warn { color: var(--cw-warn); }
.cw-lvl-track, .cw-mini-track { height: 8px; border-radius: 4px; background: #1b1e2e; overflow: hidden; }
.cw-lvl-track i, .cw-mini-track i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, #34d399); border-radius: 4px; }
.cw-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cw-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bc) 22%, transparent);
    border: 1.5px solid var(--bc);
    color: #fff;
}
.cw-next-badge { display: grid; grid-template-columns: 1fr 70px auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.cw-next-badge small { display: block; font-size: 11.5px; color: var(--cw-muted); }
.cw-next-badge em { font-style: normal; font-size: 12px; color: var(--cw-muted); }
.cw-quest { padding: 10px 12px; border-radius: 12px; background: var(--cw-panel-2); border: 2px solid var(--cw-line); margin-bottom: 8px; }
.cw-quest.claimed { opacity: .55; }
.cw-quest-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.cw-quest-top em { font-style: normal; font-weight: 700; color: #ffd166; white-space: nowrap; }
.cw-quest > small { display: block; font-size: 12px; color: var(--cw-muted); margin-top: 2px; }
.cw-quest-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cw-quest-row .cw-mini-track { flex: 1; }
.cw-quest-row > span { font-size: 12px; color: var(--cw-muted); }
.cw-quest-row .cw-btn { height: 28px; font-size: 12px; }
.cw-quest-ok { font-size: 12px; font-weight: 700; color: var(--cw-good); }

/* Kartu info fasilitas umum */
.cw-info-card { width: min(400px, 100%); }
.cw-info-body { padding: 14px; overflow-y: auto; }
.cw-info-lead { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #dfe2f7; }
.cw-info-note { margin: 12px 0 0; font-size: 12px; color: var(--cw-muted); }
/* Task saya */
.cw-tasks { display: flex; flex-direction: column; gap: 12px; }
.cw-tasks > p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.cw-task-group { display: flex; flex-direction: column; gap: 4px; }
.cw-task-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--cw-muted); }
.cw-task-head span { background: var(--cw-panel-2); color: inherit; border-radius: 999px; padding: 1px 7px; font-size: 11px; }
.cw-task-head.revise { color: #ff8a8a; }
.cw-task-head.in_progress { color: #9fb0ff; }
.cw-task-head.done { color: #6fdc9a; }
.cw-task { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--cw-panel-2); color: inherit; text-decoration: none; }
.cw-task:hover { outline: 1px solid rgba(159, 176, 255, .5); }
.cw-task-kind { flex: 0 0 auto; font-size: 10.5px; font-weight: 800; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: #3b4270; color: #c7ccff; }
.cw-task-kind.asset { background: #4a3a1a; color: #ffd166; }
.cw-task-kind.training { background: #1f4a33; color: #8ff0b5; }
.cw-task-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cw-task-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-task-sub { font-size: 11.5px; color: var(--cw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-task-sub:empty { display: none; }
.cw-task-due { flex: 0 0 auto; font-size: 11.5px; color: var(--cw-muted); }
.cw-task-due.late { color: #ff8a8a; font-weight: 700; }
.cw-btn-tasks { position: relative; }
.cw-btn-friends { position: relative; }
/* Titik nongkrong: panel obrolan bersama di bawah layar (api unggun gelap, meja bundar krem) */
.cw-fire {
    position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
    width: min(560px, calc(100% - 24px)); height: var(--cw-fire-h, auto); max-height: var(--cw-fire-max, 44vh); z-index: 5;
    display: flex; flex-direction: column;
    background: rgba(38, 24, 18, .94); border: 2px solid #7a4a2a; border-radius: 18px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 0 40px rgba(255, 150, 50, .18);
    overflow: hidden; animation: cw-pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
.cw-fire[hidden] { display: none; }
.cw-fire-head { display: flex; align-items: baseline; gap: 8px; padding: 9px 40px 7px 14px; position: relative; border-bottom: 1px solid rgba(255, 200, 140, .18); }
.cw-fire-title { font-family: "Pixelify Sans", Inter, sans-serif; font-weight: 700; font-size: 16px; color: #ffd9a0; white-space: nowrap; }
.cw-fire-sub { font-size: 11.5px; color: #d9b48a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-fire-x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #ffd9a0; font-size: 20px; line-height: 1; cursor: pointer; }
.cw-fire-x:hover { background: rgba(255, 255, 255, .1); }
.cw-fire-list { flex: 1; min-height: 70px; overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; }
.cw-fire-msg { font-size: 13.5px; line-height: 1.45; color: #f6e7d4; overflow-wrap: anywhere; }
.cw-fire-msg i { font-style: normal; font-size: 10.5px; color: #a88a6a; margin-left: 6px; }
.cw-fire-msg.me span { color: #fff3c4; }
.cw-fire-empty { font-size: 13px; color: #d9b48a; padding: 6px 0; }
.cw-fire-form { display: flex; gap: 8px; padding: 8px 10px 10px; }
.cw-fire-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid #7a4a2a; background: rgba(0, 0, 0, .3); color: #fff7e6; font: inherit; font-size: 14px; outline: none; }
.cw-fire-form input:focus { border-color: #ff9f1c; }
.cw-fire.meja { background: rgba(253, 246, 227, .97); border-color: #c9a27a; box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 0 30px rgba(255, 214, 120, .25); }
.cw-fire.meja .cw-fire-head { border-bottom-color: rgba(122, 74, 42, .2); }
.cw-fire.meja .cw-fire-title, .cw-fire.meja .cw-fire-x { color: #5b3a22; }
.cw-fire.meja .cw-fire-sub, .cw-fire.meja .cw-fire-empty { color: #8a6a4a; }
.cw-fire.meja .cw-fire-msg { color: #3b2a12; }
.cw-fire.meja .cw-fire-msg.me span { color: #7a4a2a; }
.cw-fire.meja .cw-fire-msg i { color: #a88a6a; }
.cw-fire.meja .cw-fire-form input { background: #fff; color: #3b2a12; border-color: #c9a27a; }
@media (max-width: 760px) { .cw-fire { bottom: 8px; max-height: 50vh; } }
.cw-dot-badge.good { background: var(--cw-good); }
/* Teman Online (daftar di modal peta) */
.cw-map-item.cw-friend { cursor: default; flex-wrap: wrap; }
.cw-map-item.cw-friend:hover { background: transparent; }
.cw-friend .cw-map-ico { background: #3a3f5c; color: #fff; font-weight: 700; font-size: 14px; }
.cw-friend-near { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(35, 165, 90, .18); color: var(--cw-good); vertical-align: 1px; }
.cw-friend-near.afk { background: rgba(183, 121, 31, .22); color: #f0b54a; }
.cw-map-item.cw-friend.off .cw-map-ico { filter: grayscale(.7); opacity: .7; }
.cw-map-item.cw-friend.off .cw-map-name { color: var(--cw-muted); }
.cw-friend-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.cw-friend-acts .cw-btn { padding: 6px 10px; font-size: 12px; min-height: 0; }
.cw-friend-note { font-size: 12px; color: var(--cw-muted); padding: 2px 8px 8px; }
@media (max-width: 520px) { .cw-friend-acts { width: 100%; padding-left: 44px; } }
/* Pengumuman tersemat di papan Aula */
.cw-ann.pinned { padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; border: 1px solid rgba(255, 209, 102, .55); background: linear-gradient(180deg, rgba(255, 209, 102, .14), rgba(255, 209, 102, .04)); }
.cw-pray-list { display: grid; gap: 6px; }
.cw-pray {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--cw-panel-2);
    border: 2px solid var(--cw-line);
    font-size: 14px;
}
.cw-pray b { font-family: "Pixelify Sans", Inter, sans-serif; font-size: 17px; }
.cw-pray.past { opacity: .5; }
.cw-pray.next { background: #2e8b57; border-color: #7cc6a1; color: #fff; }
.cw-info-people { display: flex; flex-wrap: wrap; gap: 6px; }

/* Editor karakter */
.cw-look-wrap { display: flex; gap: 14px; padding: 14px; overflow-y: auto; }
.cw-look-preview {
    flex: 0 0 160px;
    height: 200px;
    border-radius: 14px;
    background: repeating-conic-gradient(#3a7d44 0 25%, #418a4b 0 50%) 0 0 / 32px 32px;
    border: 2px solid var(--cw-line);
    display: grid;
    place-items: center;
}
.cw-look-preview canvas { image-rendering: pixelated; }
.cw-look-opts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cw-look-row-label { font-size: 12px; font-weight: 700; color: var(--cw-muted); margin-bottom: 5px; }
.cw-look-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cw-chip {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 9px;
    border: 2px solid var(--cw-line);
    background: var(--cw-panel-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.cw-chip.swatch { padding: 0; width: 30px; }
.cw-chip.on { border-color: #fff; box-shadow: 0 0 0 2px var(--cw-accent); }

/* Kartu orang */
.cw-person {
    position: absolute;
    z-index: 7;
    min-width: 180px;
    padding: 10px 12px 12px;
    background: var(--cw-cream);
    color: #2b2116;
    border: 2px solid #2b2116;
    border-radius: 14px;
    box-shadow: var(--cw-shadow);
    transform: translate(-50%, calc(-100% - 12px));
    animation: cw-pop .18s ease-out;
}
.cw-person-name { font-family: "Pixelify Sans", Inter, sans-serif; font-weight: 700; font-size: 16px; }
.cw-person-where { font-size: 12px; color: #6b5a44; margin: 2px 0 8px; }
.cw-person .cw-btn { height: 32px; font-size: 12px; width: 100%; justify-content: center; }

/* Loading */
.cw-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    background: var(--cw-ink);
    font-family: "Pixelify Sans", Inter, sans-serif;
    font-size: 18px;
    transition: opacity .35s ease;
}
.cw-loading.done { opacity: 0; pointer-events: none; }
.cw-loading-dot {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: var(--cw-accent);
    animation: cw-hop .6s ease-in-out infinite alternate;
}
@keyframes cw-hop { to { transform: translateY(-14px) rotate(90deg); background: var(--cw-good); } }

/* ── Mobile: panel chat jadi bottom sheet ────────────────────────────── */
@media (max-width: 760px) {
    .cw-hide-sm { display: none; }
    .cw-btn { padding: 0 10px; }
    .cw-place-name { font-size: 15px; max-width: 40vw; }
    .cw-chat {
        top: auto;
        left: 0; right: 0; bottom: 0;
        width: auto;
        height: 56vh;
        height: var(--cw-sheet-h, 56dvh);
        max-height: calc(100vh - 70px);
        max-height: calc(100dvh - 70px);
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
        animation: cw-sheet .25s cubic-bezier(.2, 1.2, .4, 1);
    }
    @keyframes cw-sheet { from { transform: translateY(40%); opacity: .4; } }
    .cw-chat.min { height: auto; }
    .cw-chat.min .cw-chat-body,
    .cw-chat.min .cw-typing,
    .cw-chat.min .cw-composer { display: none; }
    .cw-chat.min .cw-chat-min svg { transform: rotate(180deg); }
    .cw-chat-grip {
        display: block;
        width: 40px; height: 4px;
        border-radius: 2px;
        background: var(--cw-line);
        margin: -2px auto 8px;
    }
    .cw-composer textarea { font-size: 16px; } /* cegah zoom iOS */
    .cw-exit { bottom: auto; top: 64px; }
    .cw-look-wrap { flex-direction: column; align-items: center; }
    .cw-look-opts { width: 100%; }
}
@media (min-width: 761px) {
    .cw-chat.min .cw-chat-body,
    .cw-chat.min .cw-typing,
    .cw-chat.min .cw-composer { display: none; }
    .cw-chat.min { bottom: auto; }
    .cw-chat.min .cw-chat-min svg { transform: rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
    .cw-chat, .cw-modal-card, .cw-person { animation: none; }
    .cw-loading-dot { animation: none; }
}

/* Kantor Admin: tombol tautan di kartu loket */
.cw-admin-link { margin-top: 10px; text-decoration: none; }
.cw-info-note a { color: #9fb0ff; }

/* ── Aula: papan pengumuman & spanduk ───────────────────────────────── */
.cw-board .cw-chat-head { background: #9b2c3c; border-bottom-color: #7f2131; }
.cw-board .cw-chat-desc { color: #ffd9df; }
.cw-board-ico { color: #ffd166; }
.cw-ann { padding: 10px 2px 12px; border-bottom: 1px dashed var(--cw-line); }
.cw-ann:last-child { border-bottom: 0; }
.cw-ann-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; }
.cw-ann-head b { color: #ffd166; font-size: 13px; }
.cw-ann-head span { color: var(--cw-muted); }
.cw-ann-author { font-size: 12px; font-weight: 700; color: #c7ccff; margin: 2px 0 3px; }
.cw-board-form { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-top: 2px solid var(--cw-line); }
.cw-board-form select, .cw-board-form textarea {
    width: 100%;
    border-radius: 10px;
    border: 2px solid var(--cw-line);
    background: #1b1e2e;
    color: var(--cw-text);
    padding: 8px 10px;
    font-size: 13.5px;
    outline: none;
}
.cw-board-form textarea { resize: vertical; min-height: 54px; }
.cw-board-form .cw-btn { justify-content: center; }
.cw-banner {
    position: absolute;
    left: 50%;
    top: 64px;
    z-index: 9;
    transform: translateX(-50%);
    max-width: min(560px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 16px 10px;
    background: #9b2c3c;
    color: #fff;
    border: 2px solid #ffd166;
    border-radius: 14px;
    box-shadow: var(--cw-shadow);
    font-size: 13px;
}
.cw-banner b { color: #ffd166; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.cw-banner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-banner.show { animation: cw-banner-in .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes cw-banner-in { from { transform: translate(-50%, -20px); opacity: 0; } }
.cw-npc-file small { font-weight: 500; color: #8a7458; }
.cw-npc-file.over { border-color: #5865f2; background: #eef0ff; }

/* Poster project (klik poster di lobi / dinding ruangan) */
.cw-poster-big { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: #11131c; }

/* Loket Skill */
.cw-info-sub { margin: 12px 0 6px; font-size: 12px; font-weight: 700; color: var(--cw-muted, #8b90a7); text-transform: uppercase; letter-spacing: .04em; }
.cw-skill-chip i { font-style: normal; font-size: 10px; opacity: .65; margin-left: 2px; }
.cw-skill-when { font-style: normal; font-size: 11px; opacity: .6; margin-left: 4px; }
.cw-sk-pend { color: #d97706; }
.cw-sk-ok { color: #16a34a; }
.cw-sk-no { color: #dc2626; }

/* Tugu Juara */
.cw-lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cw-lb-tab { border: 1px solid rgba(127,127,160,.35); background: transparent; color: inherit; border-radius: 999px; padding: 5px 12px; font: 600 12px Inter, system-ui, sans-serif; cursor: pointer; }
.cw-lb-tab.on { background: #ffd166; border-color: #ffd166; color: #3b2a12; }
.cw-lb-list { display: grid; gap: 4px; margin-bottom: 4px; }
.cw-lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: rgba(127,127,160,.08); font-size: 13px; }
.cw-lb-row.me { background: rgba(124,134,255,.18); outline: 1px solid rgba(124,134,255,.5); }
.cw-lb-rank { width: 26px; text-align: center; font-weight: 700; }
.cw-lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Peta: ikon tempat umum */
.cw-map-pub { color: #3b2a12; font-weight: 700; font-size: 15px; }

/* Notifikasi DM masuk saat pengirim tidak terlihat di tempatmu */
.cw-dmnote { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px;
    max-width: min(440px, calc(100vw - 32px)); padding: 9px 14px; border-radius: 14px; border: 1px solid #ff8fb8; background: #2a1d33; color: #f7e8f1;
    font: 500 13px Inter, system-ui, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor: pointer; text-align: left; }
.cw-dmnote[hidden] { display: none; }
.cw-dmnote b { color: #ff8fb8; white-space: nowrap; }
.cw-dmnote span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-dmnote i { font-style: normal; font-weight: 700; color: #ffd166; white-space: nowrap; }

/* Sapa semua (Rumah Rehat, admin) */
.cw-sapa-msg { width: 100%; box-sizing: border-box; resize: vertical; border-radius: 10px; border: 1px solid rgba(127,127,160,.35);
    background: rgba(0,0,0,.25); color: inherit; font: 13px/1.5 Inter, system-ui, sans-serif; padding: 9px 11px; }
.cw-sapa-list { display: flex; flex-wrap: wrap; gap: 5px; max-height: 140px; overflow-y: auto; }

/* Tarik tepi atas panel untuk atur tinggi (DM, dan panel chat versi HP) */
.cw-chat-resize { display: none; }
.cw-chat.dm .cw-chat-resize {
    display: block; position: absolute; top: 0; left: 0; right: 0; height: 12px; z-index: 6;
    cursor: ns-resize; touch-action: none;
}
.cw-chat.dm .cw-chat-resize::after {
    content: ""; position: absolute; top: 4px; left: 50%; width: 44px; height: 4px; margin-left: -22px;
    border-radius: 2px; background: #d9b98a; opacity: .75; transition: opacity .15s, background .15s;
}
.cw-chat.dm .cw-chat-resize:hover::after, .cw-chat.resizing .cw-chat-resize::after { opacity: 1; background: #d9466f; }
.cw-chat.min .cw-chat-resize { display: none !important; }
.cw-chat.resizing { animation: none; transition: none; user-select: none; }
.cw-chat.dm .cw-chat-head { padding-top: 14px; }
@media (max-width: 760px) {
    .cw-chat .cw-chat-resize, .cw-chat.dm .cw-chat-resize { display: block; position: absolute; top: 0; left: 0; right: 0; height: 26px; z-index: 6; cursor: ns-resize; touch-action: none; }
    /* versi HP sudah punya garis pegangan (.cw-chat-grip); area tarik cukup menutupinya, jangan gambar garis kedua */
    .cw-chat.dm .cw-chat-resize::after { display: none; }
    .cw-chat.dm .cw-chat-grip { position: absolute; top: 6px; left: 50%; margin: 0 0 0 -20px; }
    .cw-chat.resizing .cw-chat-grip { background: #d9466f; }
}
.cw-btn-sound.off { opacity: .55; }

/* NPC teman (AI) */
.cw-buddy-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #2d9cdb; color: #fff;
    font: 800 10px/1.4 Inter, system-ui, sans-serif; letter-spacing: .04em; vertical-align: middle; }
.cw-buddy-heart { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 14px; background: #fff0f4;
    border-bottom: 1px solid #f3cfd9; font-size: 12px; color: #7a2343; }
.cw-buddy-heart b { font-weight: 800; }
.cw-buddy-heart span:last-child { color: #a8607a; }
.cw-buddy-hearts { color: #e0245e; letter-spacing: 1px; }
.cw-buddy-hearts i { font-style: normal; color: #e9a6bb; }
.cw-buddy-chat { max-height: 240px; overflow-y: auto; }
.cw-npc-msg.err { opacity: .75; font-style: italic; }
.cw-buddy-note { margin: 0; padding: 4px 14px 10px; font-size: 11px; color: #8a7458; }

/* Tarik tepi atas panel titik nongkrong untuk atur tinggi */
.cw-fire-resize { position: absolute; top: 0; left: 0; right: 0; height: 12px; z-index: 6; cursor: ns-resize; touch-action: none; }
.cw-fire-resize::after { content: ""; position: absolute; top: 4px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px;
    background: #a8754b; opacity: .8; transition: opacity .15s, background .15s; }
.cw-fire-resize:hover::after, .cw-fire.resizing .cw-fire-resize::after { opacity: 1; background: #ff9f1c; }
.cw-fire.meja .cw-fire-resize::after { background: #c9a27a; }
.cw-fire.resizing { animation: none; user-select: none; }
.cw-fire-head { padding-top: 13px; }
@media (max-width: 760px) { .cw-fire-resize { height: 22px; } }

/* Titik nongkrong Air Terjun: panel bertema air */
.cw-fire.air { background: rgba(232, 247, 255, .97); border-color: #5bb8e6; box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 0 34px rgba(91, 184, 230, .3); }
.cw-fire.air .cw-fire-head { border-bottom-color: rgba(20, 50, 74, .15); }
.cw-fire.air .cw-fire-title, .cw-fire.air .cw-fire-x { color: #14324a; }
.cw-fire.air .cw-fire-sub, .cw-fire.air .cw-fire-empty { color: #4a7090; }
.cw-fire.air .cw-fire-msg { color: #14324a; }
.cw-fire.air .cw-fire-msg span, .cw-fire.air .cw-fire-msg.me span { color: #0b5d8a; }   /* pesan sendiri: biru tua, bukan kuning muda tema api */
.cw-fire.air .cw-fire-msg i { color: #6f93b0; }
.cw-fire.air .cw-fire-form input { background: #ffffff; border-color: #9fd3ef; color: #14324a; }
.cw-fire.air .cw-fire-form input:focus { border-color: #2d9cdb; }
.cw-fire.air .cw-fire-resize::after { background: #8cc8e8; }

/* Kabar "baru masuk Dunia Chat" */
.cw-joins { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 9; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.cw-join { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 14px;
    background: rgba(253, 246, 227, .97); color: #2b2116; border: 2px solid #2b2116; box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
    font-size: 13px; animation: cw-join-in .3s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .35s, transform .35s; white-space: nowrap; }
.cw-join canvas { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 8px; background: #e8f6ff; }
.cw-join b { font-weight: 800; }
.cw-join .cw-btn { height: 28px; padding: 0 12px; font-size: 12px; }
.cw-join.out { opacity: 0; transform: translateY(-8px); }
@keyframes cw-join-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@media (max-width: 760px) { .cw-joins { top: 58px; width: calc(100% - 24px); } .cw-join { max-width: 100%; } .cw-join span { overflow: hidden; text-overflow: ellipsis; } }

/* Layar Promo + Markas Affiliate (Mode Dunia) */
.cw-promo-poster { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 12px; margin-bottom: 10px; background: #0f172a; }
.cw-promo-count { font-weight: 700; color: #b91c1c; margin: 6px 0; }
.cw-promo-coupon { display: block; width: 100%; margin: 8px 0; text-align: center; }
.cw-aff-tabs { display: flex; gap: 6px; margin: 8px 0; }
.cw-aff-tab { flex: 1; padding: 8px 6px; border-radius: 10px; border: 1px solid rgba(100,116,139,.35); background: transparent; color: inherit; font-weight: 700; cursor: pointer; }
.cw-aff-tab.on { background: #065f46; border-color: #065f46; color: #fde68a; }
.cw-aff-cards { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 6px; margin: 8px 0; }
.cw-aff-cards > div { padding: 10px 6px; border-radius: 12px; background: rgba(16,185,129,.12); text-align: center; }
.cw-aff-cards span { display: block; font-size: 11px; opacity: .75; }
.cw-aff-cards b { display: block; font-size: 17px; margin-top: 2px; word-break: break-word; }
.cw-aff-bar { height: 8px; border-radius: 6px; background: rgba(100,116,139,.25); overflow: hidden; margin: 8px 0 2px; }
.cw-aff-bar i { display: block; height: 100%; background: linear-gradient(90deg,#10b981,#facc15); }
.cw-aff-me { margin-top: 10px; }
.cw-aff-copy { margin-top: 8px; width: 100%; }
@media (max-width: 420px) { .cw-aff-cards { grid-template-columns: 1fr 1fr; } .cw-aff-cards > div:last-child { grid-column: 1 / -1; } }

/* Markas Affiliate: panel lebar, semua angka langsung terlihat */
.cw-modal.cw-wide .cw-info-card { width: min(980px, 100%); max-height: min(880px, calc(100vh - 24px)); }
.cw-aff-hero { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 16px; margin-bottom: 14px;
  background: radial-gradient(120% 140% at 0% 0%, #065f46 0%, #064e3b 45%, #1e1b4b 100%); color: #ecfdf5; box-shadow: inset 0 0 0 1px rgba(250,204,21,.35); }
.cw-aff-hero h3 { margin: 0 0 4px; font-size: clamp(16px, 2.4vw, 22px); color: #fde68a; }
.cw-aff-hero p { margin: 0 0 8px; opacity: .85; font-size: 13px; }
.cw-aff-paid { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(250,204,21,.18); color: #fde68a; }
.cw-aff-paid:empty { display: none; }
.cw-aff-coin { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #92400e;
  background: radial-gradient(circle at 30% 25%, #fef08a, #facc15 55%, #ca8a04); box-shadow: 0 0 0 4px rgba(250,204,21,.3), 0 0 28px rgba(250,204,21,.45); animation: cw-aff-spin 3.2s ease-in-out infinite; }
@keyframes cw-aff-spin { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
.cw-aff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cw-aff-col { padding: 16px; border-radius: 16px; border: 1px solid rgba(148,163,184,.3); background: rgba(16,185,129,.08); }
.cw-aff-col.all { background: rgba(250,204,21,.08); }
.cw-aff-coltitle { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.cw-aff-sub { font-size: 12px; opacity: .7; margin: 2px 0 12px; }
.cw-aff-big { padding: 12px; border-radius: 12px; background: rgba(0,0,0,.18); margin-bottom: 10px; text-align: center; }
.cw-aff-big span, .cw-aff-pair span, .cw-aff-mestats span { display: block; font-size: 11px; opacity: .7; }
.cw-aff-big b { display: block; font-size: clamp(24px, 4.4vw, 40px); font-weight: 900; line-height: 1.1; color: #34d399; word-break: break-word; }
.cw-aff-col.all .cw-aff-big b { color: #facc15; }
.cw-aff-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cw-aff-pair > div { text-align: center; padding: 10px 6px; border-radius: 12px; background: rgba(0,0,0,.14); }
.cw-aff-pair b { display: block; font-size: clamp(18px, 3vw, 26px); font-weight: 800; }
.cw-aff-lower { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; margin-top: 12px; }
.cw-aff-lower > section { padding: 14px; border-radius: 16px; border: 1px solid rgba(148,163,184,.3); }
.cw-aff-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; background: rgba(0,0,0,.14); font-size: 13px; }
.cw-aff-row b { color: #34d399; white-space: nowrap; }
.cw-aff-mehead { font-weight: 800; margin-bottom: 8px; }
.cw-aff-mestats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.cw-aff-mestats > div { padding: 8px 4px; border-radius: 10px; background: rgba(0,0,0,.14); }
.cw-aff-mestats b { font-size: 15px; }
@media (max-width: 640px) {
  .cw-aff-cols, .cw-aff-lower { grid-template-columns: 1fr; }
  .cw-aff-hero { padding: 14px; } .cw-aff-coin { width: 48px; height: 48px; font-size: 26px; }
}
