/* BlackVeil chat v0.2.65. Event-driven; no gameplay HUD controls are repurposed. */
.bv-chat-toggle,.bv-chat-panel,.bv-chat-gear-modal{font-family:Pretendard,Arial,sans-serif;box-sizing:border-box}
.bv-chat-toggle[hidden],.bv-chat-panel[hidden],.bv-chat-gear-modal[hidden],.bv-chat-target[hidden],.bv-chat-attachment[hidden],.bv-chat-user-menu[hidden]{display:none!important}
.bv-chat-toggle{position:absolute;left:calc(14px + env(safe-area-inset-left));bottom:env(safe-area-inset-bottom);z-index:22;min-height:36px;padding:7px 14px;border:1px solid #7b6950;border-bottom:0;border-radius:6px 6px 0 0;background:rgba(25,24,21,.90);color:#e7d6b5;font-size:12px;font-weight:700;cursor:pointer;box-shadow:0 3px 12px #0009;touch-action:manipulation}
.bv-chat-toggle.bv-chat-unread::after{content:'';position:absolute;right:-3px;top:-3px;width:8px;height:8px;border-radius:100%;background:#bd694f;border:1px solid #292019}
.bv-chat-panel{position:absolute;left:calc(14px + env(safe-area-inset-left));bottom:calc(44px + env(safe-area-inset-bottom));z-index:23;width:min(390px,calc(100vw - 22px));height:min(314px,46vh);min-height:200px;border:1px solid #665640;border-radius:6px;display:flex;flex-direction:column;color:#e4d8c1;background:linear-gradient(165deg,rgba(31,30,27,.97),rgba(15,17,16,.95));box-shadow:0 8px 22px #000c;overflow:hidden}
.bv-chat-panel *,.bv-chat-gear-modal *{box-sizing:border-box}
.bv-chat-header{display:flex;align-items:center;gap:12px;min-height:33px;padding:5px 10px;border-bottom:1px solid #64553c;background:#2c2a24;font-size:11px;font-weight:700;letter-spacing:1px;color:#d5c296}
.bv-chat-header small{margin-left:auto;color:#a7a18e;font-size:11px;letter-spacing:0}
.bv-chat-header button,.bv-chat-gear-card header button{border:0;background:none;color:#e9d4ab;font-size:21px;cursor:pointer;padding:0 3px}
.bv-chat-tabs{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-bottom:1px solid #514737}
.bv-chat-tabs button{min-width:0;white-space:nowrap;padding:7px 1px;border:0;border-right:1px solid #3d3930;background:#25251f;color:#a8a294;font-size:11px;cursor:pointer}
.bv-chat-tabs button.is-active{color:#f3d9a3;background:#40372b;box-shadow:inset 0 -2px #bb9666}
.bv-chat-history{flex:1;min-height:0;overflow:auto;overflow-wrap:anywhere;padding:7px 9px;scrollbar-width:thin;scrollbar-color:#807056 transparent}
.bv-chat-line{font-size:12px;line-height:1.65;display:flex;align-items:baseline;flex-wrap:wrap;gap:5px;margin-bottom:3px;color:#ece4d4}
.bv-chat-time{color:#837d71;font-size:10px;flex:none}
.bv-chat-name{border:0;padding:0;background:none;font:inherit;font-size:12px;color:#ddc894;font-weight:700;cursor:pointer}
.bv-chat-to{font-size:11px;color:#a4b8d9}.bv-chat-text{white-space:pre-wrap;overflow-wrap:anywhere}
.bv-chat-whisper .bv-chat-name{color:#b9b0e8}.bv-chat-nearby .bv-chat-name{color:#a7cfa7}
.bv-chat-item-link{border:0;padding:0 2px;background:none;font:inherit;font-size:12px;font-weight:700;cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.bv-chat-form{padding:6px;border-top:1px solid #5a4c3c;background:#24231f}
.bv-chat-compose{display:flex;gap:6px}.bv-chat-compose input,.bv-chat-target input{min-width:0;width:100%;outline:0;border:1px solid #61523e;background:#131514;color:#e6dcc8;border-radius:3px;padding:7px 8px;font-size:12px}
.bv-chat-compose input:focus,.bv-chat-target input:focus{border-color:#b3915d}
.bv-chat-compose button{width:55px;flex:none;background:#6b5235;border:1px solid #a18459;border-radius:3px;color:#f5e5c9;font-size:12px;font-weight:700;cursor:pointer}
.bv-chat-compose button:disabled{opacity:.48;cursor:default}
.bv-chat-target{display:flex;align-items:center;gap:8px;font-size:11px;color:#a9a08e;margin-bottom:5px;white-space:nowrap}.bv-chat-target input{padding:4px 6px}
.bv-chat-attachment{display:flex;align-items:center;justify-content:space-between;margin:0 0 5px;padding:3px 6px;border:1px solid #66573b;color:#e5c890;font-size:11px;border-radius:3px;background:#332d23}
.bv-chat-attachment button{border:0;background:none;color:#eee0bf;font-size:16px;cursor:pointer}
.bv-chat-user-menu{position:absolute;z-index:3;left:8px;bottom:60px;min-width:173px;max-width:calc(100% - 16px);padding:8px;background:#242520;border:1px solid #a18a66;border-radius:4px;box-shadow:0 8px 20px #000b;display:flex;flex-direction:column;gap:4px}
.bv-chat-user-menu strong{font-size:12px;color:#e4ca98}.bv-chat-user-menu button{border:1px solid #655844;background:#37332a;color:#e6d6b9;text-align:left;border-radius:3px;padding:5px;font-size:11px;cursor:pointer}.bv-chat-user-menu button:disabled{opacity:.42;cursor:not-allowed}
.bv-chat-gear-modal{position:fixed;inset:0;z-index:95;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.67);padding:15px}
.bv-chat-gear-card{width:min(370px,95vw);max-height:80vh;overflow-y:auto;padding:14px 16px;background:linear-gradient(#302c26,#1c1e1b);border:1px solid #997c4f;box-shadow:0 12px 35px #000e;color:#e2d3b9;border-radius:6px}
.bv-chat-gear-card header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #69563d;padding-bottom:7px;font-weight:700;font-size:13px;color:#e5d09e}
.bv-chat-gear-hero{display:flex;align-items:center;gap:12px;min-height:60px;padding:8px 0}.bv-chat-gear-hero img{width:50px;height:50px;object-fit:contain}.bv-chat-gear-name{font-size:16px;font-weight:700}
.bv-chat-gear-stat{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid #ffffff16;padding:5px 0;font-size:12px}.bv-chat-gear-stat span{color:#bbb4a7}.bv-chat-gear-stat strong{text-align:right;overflow-wrap:anywhere}
.bv-chat-gear-card p{color:#a39c8e;font-size:11px;line-height:1.6;margin:10px 0 0}
/* Place the shortcut at the bottom edge, below joystick/run/attack controls.
   Keep the opened panel ABOVE those controls so touches never block movement. */
@media (pointer:coarse), (max-width:780px){
 .bv-chat-toggle{left:calc(12px + env(safe-area-inset-left));bottom:env(safe-area-inset-bottom);}
 .bv-chat-panel{left:calc(9px + env(safe-area-inset-left));bottom:calc(189px + env(safe-area-inset-bottom));
   width:min(354px,calc(100vw - 18px - env(safe-area-inset-left) - env(safe-area-inset-right)));
   height:min(280px,38dvh);min-height:150px;}
 .bv-chat-line{font-size:11px}
}
@media (pointer:coarse) and (max-height:560px), (max-width:780px) and (max-height:560px){
 .bv-chat-panel{bottom:calc(155px + env(safe-area-inset-bottom));height:min(230px,40dvh);min-height:110px;}
}
@media (pointer:coarse) and (max-height:420px), (max-width:780px) and (max-height:420px){
 .bv-chat-panel{bottom:calc(126px + env(safe-area-inset-bottom));height:min(190px,42dvh);min-height:96px;}
}


.bv-item-chat-link{margin-left:auto;margin-right:8px;background:#493d2b;border:1px solid #a08a66;border-radius:3px;color:#f0d9a5;padding:5px 8px;font-size:12px;cursor:pointer}.bv-item-chat-link[hidden]{display:none!important}

/* v0.2.65.2: floating, movable and resizable chat. Controls are placed inside
   the existing window, with no modification to gameplay/canvas dimensions. */
.bv-chat-panel{max-width:calc(100vw - 8px);max-height:calc(100dvh - 8px);
 min-width:min(240px,calc(100vw - 8px));min-height:min(130px,calc(100dvh - 8px))}
.bv-chat-header{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.bv-chat-header:active{cursor:grabbing}
.bv-chat-header small{white-space:nowrap}
.bv-chat-header button{cursor:pointer;flex:none;touch-action:manipulation}
#bv-chat-layout-reset{font-size:17px;line-height:1;opacity:.82}
#bv-chat-layout-reset:hover{opacity:1;color:#ffe0a3}
.bv-chat-form{padding-right:17px}
.bv-chat-resize{position:absolute;right:2px;bottom:2px;z-index:2;
 display:flex;align-items:flex-end;justify-content:flex-end;width:19px;height:20px;
 padding:0 2px 0 0;border:0;background:transparent;color:#b99d70;
 font-size:14px;line-height:1;cursor:nwse-resize;touch-action:none;user-select:none}
.bv-chat-resize:hover,.bv-chat-resize:focus-visible{color:#f2cf8f}
.bv-chat-unavailable{font-size:12px;line-height:1.7;margin:12px 5px;
 padding:12px;border:1px solid #5d503c;border-radius:3px;
 background:rgba(40,38,31,.6);color:#c7b99e;overflow-wrap:anywhere}
@media (max-width:400px){.bv-chat-tabs button{font-size:10px;letter-spacing:-.25px}}

.bv-chat-open-friends{margin:3px 8px;border:1px solid #8e7651;border-radius:4px;padding:7px 14px;
 background:#40352a;color:#ebd3ab;cursor:pointer;font-size:12px}

.bv-chat-header, .bv-chat-header:active {cursor:url('../assets/cursors/ui_move.png') 16 16, move!important;}
