
/* TOTOCATCH live chat: scoped styles */
#tc-chat{background:#fff;border:1px solid #e2e7ef;border-radius:12px;overflow:hidden;margin:0 0 20px;box-shadow:0 3px 12px #13233a12;font-family:SUIT,Pretendard,Arial,sans-serif;color:#172333}
#tc-chat *{box-sizing:border-box}
.tc-chat-head{background:linear-gradient(115deg,#a60012,#dc1925);color:#fff;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.tc-chat-head strong{font-size:19px}.tc-chat-head small{font-size:12px;color:#ffe9e9;display:block}.tc-chat-live{font-size:12px;font-weight:700;background:#fa3541;padding:5px 10px;border-radius:20px;white-space:nowrap}
.tc-chat-info{background:#fff7f7;border-bottom:1px solid #f1e2e2;padding:8px 15px;font-size:12px;color:#7d4046}
.tc-chat-messages{height:350px;overflow:auto;padding:12px 16px;background:#fff;scrollbar-width:thin}
.tc-chat-line{display:grid;grid-template-columns:26px minmax(78px,110px) minmax(0,1fr) auto;align-items:start;gap:8px;padding:7px 0;border-bottom:1px solid #f4f5f8;font-size:13px;line-height:1.5}
.tc-chat-avatar{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:#e9eef5;color:#44546a;font-size:12px}.tc-chat-name{font-weight:800;overflow-wrap:anywhere}.tc-chat-body{white-space:pre-wrap;overflow-wrap:anywhere}.tc-chat-time{font-size:11px;color:#929aa8;white-space:nowrap}.tc-chat-empty{color:#778395;font-size:13px;text-align:center;padding:70px 8px}
.tc-chat-form{display:flex;gap:7px;padding:11px;background:#f8f9fc;border-top:1px solid #e8ebf0;align-items:center}
.tc-chat-form input{min-width:0;border:1px solid #d9dee7;border-radius:7px;padding:11px 10px;font-size:13px;background:white;color:#172333;outline-offset:2px}
#tc-chat-nick{width:120px;flex:none}#tc-chat-message{flex:1}#tc-chat-send{border:0;background:#d81725;color:#fff;border-radius:7px;padding:11px 14px;font-size:13px;font-weight:800;cursor:pointer;white-space:nowrap}#tc-chat-send:disabled{opacity:.55;cursor:wait}
.tc-chat-status{padding:0 12px 10px;background:#f8f9fc;color:#667487;font-size:12px;min-height:22px}
@media(max-width:650px){.tc-chat-head{padding:12px}.tc-chat-head strong{font-size:16px}.tc-chat-messages{height:300px;padding:8px}.tc-chat-line{grid-template-columns:22px minmax(65px,85px) minmax(0,1fr);gap:5px;font-size:12px}.tc-chat-time{grid-column:3;text-align:right}.tc-chat-form{flex-wrap:wrap}#tc-chat-nick{width:100px}#tc-chat-message{flex:1 1 50%}#tc-chat-send{padding:11px}}

/* Chat legibility and original user-supplied rank emblems */
#tc-chat .tc-chat-head{padding:16px 18px}#tc-chat .tc-chat-head strong{font-size:21px}#tc-chat .tc-chat-head small{font-size:14px;margin-top:4px}#tc-chat .tc-chat-info{font-size:14px;padding:10px 16px}#tc-chat .tc-chat-messages{height:390px;padding:12px 16px}#tc-chat .tc-chat-line{grid-template-columns:42px minmax(115px,155px) minmax(0,1fr) auto;gap:10px;padding:10px 0;font-size:15px;align-items:center}#tc-chat .tc-chat-avatar{background:transparent;border-radius:0;width:40px;height:40px}#tc-chat .tc-chat-avatar img{width:40px;height:40px;object-fit:contain}#tc-chat .tc-chat-name{font-size:15px}#tc-chat .tc-chat-time{font-size:12px}#tc-chat .tc-chat-form input{font-size:15px}#tc-chat .tc-chat-status{font-size:13px}#tc-chat .tc-chat-rank-label{display:block;font-size:11px;color:#67758b;font-weight:700}#tc-chat .tc-chat-gm .tc-chat-name{color:#ad7100}#tc-chat .tc-chat-gm .tc-chat-rank-label{color:#a16b00}#tc-chat .tc-chat-gm{background:linear-gradient(90deg,#fff7e5,transparent);border-radius:6px;padding-left:4px}#tc-chat .tc-chat-namewrap{min-width:0}
@media(max-width:650px){#tc-chat .tc-chat-head strong{font-size:18px}#tc-chat .tc-chat-messages{height:340px}#tc-chat .tc-chat-line{grid-template-columns:34px minmax(74px,104px) minmax(0,1fr);gap:6px;font-size:14px}#tc-chat .tc-chat-avatar,#tc-chat .tc-chat-avatar img{width:32px;height:32px}#tc-chat .tc-chat-name{font-size:13px}#tc-chat .tc-chat-time{grid-column:3;font-size:11px}#tc-chat .tc-chat-form input{font-size:14px}}

/* GM moderation and fixed nickname */
#tc-chat .tc-chat-line{position:relative;grid-template-columns:42px minmax(115px,155px) minmax(0,1fr) auto auto}
#tc-chat .tc-chat-manage{border:1px solid #e7c6c6;background:#fff;color:#ad1d2b;border-radius:5px;padding:5px 7px;font-size:12px;cursor:pointer}
#tc-chat #tc-chat-nick[readonly]{background:#f1f3f6;color:#596274;cursor:not-allowed}
@media(max-width:650px){#tc-chat .tc-chat-line{grid-template-columns:34px minmax(74px,104px) minmax(0,1fr) auto}#tc-chat .tc-chat-manage{grid-column:4;grid-row:1 / span 2}#tc-chat .tc-chat-time{grid-column:3}}

/* PC-only readability refinement — preserves mobile, ranks, GM and moderation */
@media (min-width: 651px) {
  #tc-chat { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  #tc-chat .tc-chat-messages { padding: 14px 18px; }
  #tc-chat .tc-chat-line { grid-template-columns: 46px minmax(125px,165px) minmax(0,1fr) auto auto; gap: 12px; padding: 10px 6px; min-height: 62px; font-size: 15px; font-weight: 500; line-height: 1.6; color: #182438; }
  #tc-chat .tc-chat-avatar, #tc-chat .tc-chat-avatar img { width: 42px; height: 42px; }
  #tc-chat .tc-chat-name { font-size: 14px; font-weight: 800; line-height: 1.4; color: #142744; }
  #tc-chat .tc-chat-gm .tc-chat-name { color: #996000; }
  #tc-chat .tc-chat-rank-label { font-size: 12px; line-height: 1.4; }
  #tc-chat .tc-chat-body { font-size: 15px; font-weight: 500; line-height: 1.6; color: #182438; }
  #tc-chat .tc-chat-time { font-size: 12px; color: #59677a; }
  #tc-chat .tc-chat-manage { font-size: 12px; font-weight: 700; }
  #tc-chat .tc-chat-form input { font-size: 15px; }
  #tc-chat .tc-chat-status { color: #526174; }
}

/* PC chat polish: compact author column, clearer emblems, taller history, hover-only GM actions */
@media (min-width: 651px) {
  #tc-chat .tc-chat-messages { height: 480px; }
  #tc-chat .tc-chat-line { grid-template-columns: 50px minmax(95px,125px) minmax(0,1fr) auto auto; column-gap: 8px; min-height: 62px; }
  #tc-chat .tc-chat-avatar, #tc-chat .tc-chat-avatar img { width: 46px; height: 46px; }
  #tc-chat .tc-chat-avatar img { object-fit: contain; image-rendering: auto; }
  #tc-chat .tc-chat-namewrap { padding-right: 2px; }
  #tc-chat .tc-chat-manage { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease; }
  #tc-chat .tc-chat-line:hover .tc-chat-manage,
  #tc-chat .tc-chat-line:focus-within .tc-chat-manage { opacity: 1; visibility: visible; pointer-events: auto; }
}
@media (min-width: 651px) and (hover: none) {
  #tc-chat .tc-chat-manage { opacity: 1; visibility: visible; pointer-events: auto; }
}


/* TOTOCATCH Premium Chat — visual-only upgrade. All moderation/ranks/realtime JS preserved. */
#tc-chat{
  border:1px solid #d8e2f0;
  border-radius:13px;
  box-shadow:0 8px 24px rgba(20,41,79,.08);
  color:#17233b;
}
#tc-chat .tc-chat-head{
  position:relative;
  background:linear-gradient(108deg,#b40014 0%,#d6001a 62%,#ad0016 100%);
  padding:19px 22px;
  min-height:84px;
}
#tc-chat .tc-chat-head::after{
  content:"♛";
  position:absolute;
  right:100px;
  top:-30px;
  font-size:105px;
  color:rgba(255,255,255,.065);
  pointer-events:none;
}
#tc-chat .tc-chat-head strong{font-size:21px;letter-spacing:-.45px}
#tc-chat .tc-chat-head small{font-size:13px;color:#fff2f2}
#tc-chat .tc-chat-live{
  border:1px solid rgba(255,255,255,.5);
  background:#ef162d;
  padding:7px 13px;
  box-shadow:0 0 0 3px rgba(255,255,255,.08);
}
#tc-chat .tc-chat-info{
  background:#fff4f5;
  border-bottom:1px solid #f1dfe2;
  color:#9d2936;
  font-size:13px;
  padding:11px 17px;
}
#tc-chat .tc-chat-messages{background:#fff}
#tc-chat .tc-chat-line{
  border-bottom:1px solid #edf1f7;
  transition:background .15s ease;
}
#tc-chat .tc-chat-line:hover{background:#fafcff}
#tc-chat .tc-chat-avatar{background:transparent}
#tc-chat .tc-chat-name{color:#132d55;font-weight:800}
#tc-chat .tc-chat-rank-label{color:#687894}
#tc-chat .tc-chat-body{
  width:fit-content;
  max-width:100%;
  padding:9px 15px;
  border:1px solid #dbe4f3;
  border-radius:16px 16px 16px 5px;
  background:linear-gradient(180deg,#f8faff,#edf3ff);
  color:#172844;
  box-shadow:0 2px 4px rgba(30,55,99,.045);
  line-height:1.5;
}
#tc-chat .tc-chat-gm{
  background:linear-gradient(90deg,#fffaf0,#fff 78%);
  border-radius:9px;
}
#tc-chat .tc-chat-gm .tc-chat-name{color:#a36300}
#tc-chat .tc-chat-gm .tc-chat-rank-label{color:#a36300}
#tc-chat .tc-chat-gm .tc-chat-body{
  background:linear-gradient(180deg,#fffaf0,#fff0cc);
  border-color:#f0d38d;
  color:#513900;
}
#tc-chat .tc-chat-time{color:#697b96}
#tc-chat .tc-chat-form{
  background:#f6f8fc;
  border-top:1px solid #dce5f2;
  padding:13px 12px;
  gap:9px;
}
#tc-chat .tc-chat-form input{
  border:1px solid #cfd9e8;
  border-radius:9px;
  background:#fff;
  box-shadow:0 1px 2px rgba(20,40,70,.03);
}
#tc-chat .tc-chat-form input:focus{
  border-color:#6d95d1;
  outline:2px solid rgba(56,114,198,.14);
}
#tc-chat #tc-chat-send{
  background:linear-gradient(180deg,#ed1127,#c90019);
  border-radius:9px;
  padding:12px 19px;
  box-shadow:0 3px 8px rgba(200,0,26,.15);
}
#tc-chat .tc-chat-status{background:#f6f8fc}
@media(min-width:651px){
  #tc-chat .tc-chat-messages{height:480px;padding:12px 17px}
  #tc-chat .tc-chat-line{
    grid-template-columns:48px minmax(98px,124px) minmax(0,1fr) auto auto;
    gap:10px;
    min-height:66px;
    padding:9px 6px;
  }
  #tc-chat .tc-chat-avatar,
  #tc-chat .tc-chat-avatar img{width:46px;height:46px}
  #tc-chat .tc-chat-name{font-size:15px}
  #tc-chat .tc-chat-body{font-size:15px}
  #tc-chat .tc-chat-manage{
    border-radius:7px;
    padding:6px 9px;
  }
}
@media(max-width:650px){
  #tc-chat .tc-chat-head{min-height:70px;padding:13px}
  #tc-chat .tc-chat-head strong{font-size:17px}
  #tc-chat .tc-chat-head small{font-size:12px}
  #tc-chat .tc-chat-head::after{display:none}
  #tc-chat .tc-chat-info{font-size:12px}
  #tc-chat .tc-chat-messages{height:340px;padding:8px}
  #tc-chat .tc-chat-line{
    grid-template-columns:34px minmax(70px,100px) minmax(0,1fr) auto;
    gap:5px;
    padding:8px 3px;
  }
  #tc-chat .tc-chat-body{font-size:13px;padding:7px 9px}
  #tc-chat .tc-chat-form{padding:9px;gap:6px}
  #tc-chat #tc-chat-send{padding:11px}
}

/* Brand header and permanent bottom moderation notice */
#tc-chat .tc-chat-brand{display:flex;align-items:center;gap:12px;min-width:0}
#tc-chat .tc-chat-brand img{width:155px;height:43px;object-fit:contain;flex:none;filter:drop-shadow(0 1px 1px rgba(0,0,0,.12))}
#tc-chat .tc-chat-brand strong{font-size:19px;line-height:1.25;white-space:nowrap;color:#fff}
#tc-chat .tc-chat-guideline{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:11px 15px;background:#fff3f3;border-top:1px solid #f1d9dc;color:#8d2731;font-size:12px;line-height:1.55}
#tc-chat .tc-chat-guideline-label{font-weight:800;color:#af1022;white-space:nowrap}
@media(max-width:650px){
 #tc-chat .tc-chat-brand{gap:7px}
 #tc-chat .tc-chat-brand img{width:105px;height:31px}
 #tc-chat .tc-chat-brand strong{font-size:15px}
 #tc-chat .tc-chat-guideline{padding:9px 11px;gap:4px;font-size:11px}
}
@media(max-width:370px){#tc-chat .tc-chat-brand img{width:86px}#tc-chat .tc-chat-brand strong{font-size:13px}}

/* Fix: clean brand alignment, readable logo, no decorative crown. */
#tc-chat .tc-chat-head::after{content:none!important;display:none!important}
#tc-chat .tc-chat-head{
  min-height:76px!important;
  padding:13px 17px!important;
  background:#c9001a!important;
}
#tc-chat .tc-chat-brand{gap:12px!important;align-items:center!important}
#tc-chat .tc-chat-brand img{
  display:block!important;
  width:154px!important;
  height:auto!important;
  max-height:43px!important;
  object-fit:contain!important;
  padding:6px 8px!important;
  background:#fff!important;
  border-radius:7px!important;
  filter:none!important;
}
#tc-chat .tc-chat-brand strong{
  font-size:19px!important;
  line-height:1.25!important;
  letter-spacing:-.4px!important;
  color:#fff!important;
}
#tc-chat .tc-chat-head small{
  margin-top:5px!important;
  font-size:12px!important;
  color:#ffe7e9!important;
}
#tc-chat .tc-chat-live{flex:none!important;white-space:nowrap!important}
#tc-chat .tc-chat-guideline{
  display:flex!important;
  background:#fff4f4!important;
  color:#832b34!important;
  border-top:1px solid #f1d8dc!important;
  padding:11px 14px!important;
}
@media(max-width:650px){
 #tc-chat .tc-chat-head{min-height:68px!important;padding:12px!important}
 #tc-chat .tc-chat-brand{gap:8px!important}
 #tc-chat .tc-chat-brand img{width:116px!important;max-height:34px!important;padding:5px!important}
 #tc-chat .tc-chat-brand strong{font-size:15px!important}
 #tc-chat .tc-chat-head small{font-size:11px!important}
}
@media(max-width:390px){
 #tc-chat .tc-chat-brand img{width:94px!important}
 #tc-chat .tc-chat-brand strong{font-size:14px!important}
}

/* Final requested header: crisp white speech bubbles and readable moderation notice */
#tc-chat .tc-chat-head::after{display:none!important;content:none!important}
#tc-chat .tc-chat-head{background:#c9001a!important;padding:13px 17px!important;min-height:76px!important}
#tc-chat .tc-chat-brand{display:flex!important;align-items:center!important;gap:10px!important}
#tc-chat .tc-chat-brand .tc-chat-bubble-icon{width:28px;height:28px;flex:none;display:block;fill:#fff}
#tc-chat .tc-chat-brand strong{font-size:19px!important;color:white!important;white-space:nowrap}
#tc-chat .tc-chat-info{font-size:13px!important;font-weight:500!important;line-height:1.55!important;padding:11px 15px!important;color:#842c36!important;background:#fff3f4!important;display:flex;align-items:center;gap:6px}
#tc-chat .tc-chat-info strong{color:#b30b25!important;font-weight:800!important;white-space:nowrap}
#tc-chat .tc-chat-notice-icon{width:17px;height:17px;flex:none;fill:#d20d2b;display:inline-block}
@media(max-width:650px){#tc-chat .tc-chat-head{min-height:68px!important;padding:12px!important}#tc-chat .tc-chat-brand .tc-chat-bubble-icon{width:23px;height:23px}#tc-chat .tc-chat-brand strong{font-size:15px!important}#tc-chat .tc-chat-info{font-size:12px!important;padding:10px 11px!important;gap:4px}}

/* Automated chat: keep badge, message and timestamp aligned on every screen */
#tc-chat .tc-chat-line{display:grid;grid-template-columns:46px minmax(96px,124px) minmax(0,1fr) 64px auto;align-items:center;column-gap:10px;row-gap:4px}
#tc-chat .tc-chat-line>.tc-chat-avatar{grid-column:1;grid-row:1;align-self:center}
#tc-chat .tc-chat-line>.tc-chat-namewrap{grid-column:2;grid-row:1;align-self:center}
#tc-chat .tc-chat-line>.tc-chat-body{grid-column:3;grid-row:1;min-width:0;max-width:100%;justify-self:start}
#tc-chat .tc-chat-line>.tc-chat-time{grid-column:4;grid-row:1;justify-self:end;align-self:center;white-space:nowrap;font-variant-numeric:tabular-nums}
#tc-chat .tc-chat-line>.tc-chat-manage{grid-column:5;grid-row:1}
#tc-chat .tc-chat-automated .tc-chat-rank-label{color:#687894;font-size:11px}
#tc-chat .tc-chat-automated .tc-chat-avatar img{display:block;object-fit:contain}
@media(max-width:650px){
 #tc-chat .tc-chat-line{grid-template-columns:34px minmax(64px,90px) minmax(0,1fr) 48px;column-gap:5px;row-gap:4px}
 #tc-chat .tc-chat-line>.tc-chat-time{grid-column:4;grid-row:1;font-size:10px}
 #tc-chat .tc-chat-line>.tc-chat-manage{grid-column:3 / 5;grid-row:2;justify-self:end}
 #tc-chat .tc-chat-line>.tc-chat-body{font-size:13px;overflow-wrap:anywhere}
}

/* Compact disclosure for scripted messages */
#tc-chat .tc-chat-automated .tc-chat-rank-label{display:inline-block!important;font-size:10px!important;line-height:1.25!important;color:#64748b!important;letter-spacing:0!important}

/* v23 PC readability polish; mobile chat remains unchanged */
@media (min-width:901px){
 #tc-chat .tc-chat-line{padding-top:7px!important;padding-bottom:7px!important;row-gap:6px!important}
 #tc-chat .tc-chat-body{font-size:16px!important;line-height:1.55!important}
 #tc-chat .tc-chat-name{font-size:15px!important}
}

/* Hide message timestamps; preserve AI identification */
#tc-chat .tc-chat-time{display:none!important}
