/* CIBERCHESS.ES — panel de jugadores, chat y preferencias. */
#cc-hub{background:#13253a;border:1px solid #3d5871;border-radius:18px;overflow:visible;box-shadow:0 12px 30px #0003;color:#eef4ff}
#cc-hub [hidden]{display:none!important}
#cc-hub .cc-hub-tabs{display:flex;gap:6px;padding:10px;background:#1b3248;border-radius:17px 17px 0 0;border-bottom:1px solid #385269}
#cc-hub .cc-hub-tab{display:flex;align-items:center;justify-content:center;gap:7px;flex:1;min-width:0;min-height:44px;padding:10px 8px;margin:0;background:#162b40;border:1px solid #3b536c;border-radius:11px;color:#c9d9e9;font:700 14px/1.3 system-ui;box-shadow:none;transform:none;width:auto}
#cc-hub .cc-hub-tab[aria-selected=true]{background:#255247;border-color:#6aaa90;color:#effff5}
#cc-hub button:focus-visible,#cc-hub select:focus-visible{outline:3px solid #ecd38a;outline-offset:2px}
#cc-hub .cc-hub-unread{color:#ecd38a;font-size:20px;line-height:1}
#cc-hub .cc-hub-pane{padding:14px;min-width:0}
#cc-hub .panel{margin:0;border:0;box-shadow:none;border-radius:12px}
#cc-hub .cc-panel{max-height:220px;overflow:auto}
#cc-hub .table{font-size:14px}
#cc-hub .table td[colspan]{background:#172f44!important;color:#c6d7e9!important;font-size:14px;text-align:left;padding:16px;line-height:1.5}
#cc-hub #cc-chat-panel{margin:0;border:0;box-shadow:none;background:#13253a}
#cc-hub .cc-chat-header{background:transparent;padding-top:4px}
#cc-hub .cc-chat-messages{height:clamp(160px,30vh,300px);font-size:15px}
#cc-hub .cc-chat-text,#cc-hub .cc-chat-input{font-size:15px;line-height:1.5}
#cc-hub .cc-chat-meta{font-size:13px}
#cc-hub .cc-chat-form{padding:12px 0 0}
#cc-hub .cc-chat-input{font-size:16px}
#cc-hub .cc-sparring{margin-top:16px;padding-top:16px;border-top:1px solid #344c63}
#cc-hub-chat>.cc-sparring{margin:0 0 16px;padding:0 0 14px;border-top:0;border-bottom:1px solid #344c63}
#cc-hub .cc-sparring-heading strong{display:block;font-size:16px;color:#e3f7ec}
#cc-hub .cc-sparring-heading p{font-size:13px;color:#bfd1e4;margin:6px 0 12px;line-height:1.5}
#cc-hub .cc-quick-settings{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
#cc-hub .cc-quick-settings label{font-size:12px;color:#bfd1e4;margin:0;font-weight:700}
#cc-hub .cc-quick-settings select{display:block;margin-top:5px;width:100%;min-height:44px;padding:9px 10px;border:1px solid #476079;border-radius:10px;background:#102136;color:#eef4ff;font:16px system-ui}
#cc-hub .cc-sparring-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
#cc-hub .cc-sparring-card{display:flex;align-items:center;gap:8px;text-align:left;min-width:0;min-height:68px;padding:12px 10px;background:linear-gradient(130deg,#23433f,#1b3046);border:1px solid #446b65;border-radius:12px;color:#e7f8ee;box-shadow:none;margin:0;width:100%;transform:none;font:14px system-ui}
#cc-hub .cc-sparring-card>img{object-fit:contain;flex:none;border-radius:2px}
#cc-hub .cc-sparring-card>span:nth-child(2){min-width:0;flex:1}
#cc-hub .cc-sparring-card strong{display:block;font-size:14px;overflow-wrap:anywhere}
#cc-hub .cc-sparring-card small{display:block;font-size:11px;line-height:1.4;color:#bdd5d5;margin-top:4px}
#cc-hub .cc-sparring-card:disabled{opacity:.4;cursor:not-allowed;filter:none;transform:none}
#cc-hub .cc-sparring-note,#cc-hub-status{font-size:12px;color:#aebfd4;line-height:1.45;margin:10px 0 0}
#cc-hub-status:empty{display:none}
/* Relocate the original settings node; retain its controls and event listeners. */
#cc-hub #cfg_panel.cc-hub-config{position:static!important;inset:auto!important;transform:none!important;transition:none!important;display:flex!important;flex-direction:column;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;min-height:0!important;box-shadow:none!important;border:0!important;border-radius:0!important;background:#13253a!important;z-index:auto!important;visibility:visible!important;opacity:1!important;overflow:visible!important}
#cc-hub #cfg_panel .cfg_head{padding:0 0 12px!important;color:#eef4ff;border-color:#344c63;font-size:18px}
#cc-hub #cfg_panel .cfg_body{padding:12px 0!important;height:auto!important;max-height:none!important;overflow:visible!important;flex:0 0 auto!important;min-height:0!important;scrollbar-gutter:auto}
#cc-hub #cfg_panel .row{margin-left:0!important;margin-right:0!important}
#cc-hub #cfg_panel .foot{position:static!important;display:flex!important;flex-wrap:wrap!important;padding:12px 0 0!important;border-color:#344c63;background:#13253a!important;gap:8px!important;min-height:0!important}
#cc-hub #cfg_panel .foot .btn{flex:1!important;min-width:0!important;width:auto!important;min-height:44px!important}
#cc-hub #cfg_panel .cc-hub-legacy-bot{display:none!important}
@media(hover:hover){#cc-hub .cc-sparring-card:hover:not(:disabled){border-color:#a4d5b9;background:#2b5249}}
@media(max-width:767px){#cc-hub .cc-hub-pane{padding:12px}#cc-hub .cc-chat-messages{height:200px}#cc-hub .cc-hub-tab{font-size:13px}}
@media(max-width:360px){#cc-hub .cc-sparring-grid{grid-template-columns:1fr}#cc-hub .cc-hub-tabs{gap:4px;padding:8px}#cc-hub .cc-hub-tab{font-size:12px;padding:9px 4px}}
#cc-hub #cfg_panel label{font-size:14px!important;line-height:1.4!important}
#cc-hub #cfg_panel select{font-size:16px!important;min-height:44px!important}
#cc-hub #cfg_panel .foot button{font-size:14px!important}
#cc-hub #cfg_panel .cfg_head{flex:none!important}

/* Sparrings en la misma tabla, separados del tbody gestionado por el servidor. */
#cc-hub #cc-sparring-opponents tr{background:#172e40;color:#e4f2ed}
#cc-hub #cc-sparring-opponents tr:nth-child(even){background:#1b3446}
#cc-hub #cc-sparring-opponents tr:first-child td{border-top:2px solid #528a78}
#cc-hub #cc-sparring-opponents td{vertical-align:middle;padding:12px 9px;text-align:left;border-color:#345064}
#cc-hub .cc-sparring-identity{display:inline-flex;gap:9px;align-items:center;vertical-align:middle}
#cc-hub .cc-sparring-identity img{flex:none;object-fit:contain;border-radius:2px}
#cc-hub .cc-sparring-identity strong{display:block;font-size:14px;color:#effff6;overflow-wrap:anywhere}
#cc-hub .cc-sparring-identity small{display:block;color:#b7ccdc;font-size:11px;line-height:1.45;margin-top:3px}
#cc-hub .cc-sparring-elo{display:inline-block;margin:5px 0 5px 10px;padding:4px 7px;border:1px solid #527c6c;border-radius:7px;color:#cfefdb;background:#22463f;font-size:11px;white-space:nowrap}
#cc-hub .cc-sparring-challenge{min-height:40px;padding:9px 11px;border-radius:10px;color:#e9fff1;background:linear-gradient(135deg,#2e6556,#203d3b);border:1px solid #659f87;font-size:13px;font-weight:700;box-shadow:none;transform:none}
#cc-hub .cc-sparring-challenge:disabled{opacity:.4;cursor:not-allowed;filter:none}
#cc-hub .cc-panel{max-height:clamp(260px,48vh,470px)}
@media(max-width:480px){
 #cc-hub #cc-sparring-opponents td{padding:10px 6px}
 #cc-hub .cc-sparring-elo{display:table;margin:6px 0 0 35px}
 #cc-hub .cc-sparring-challenge{padding:8px;font-size:12px}
}

/* Evitar fondos claros heredados de Bootstrap/tema en las celdas. */
#cc-hub .cc-panel,#cc-hub .cc-panel table,#cc-hub .cc-panel tbody{background:#142a3e!important;color:#e6f1fc!important}
#cc-hub #tb_oponentes>tr>td,#cc-hub #cc-sparring-opponents>tr>td{
 background:#172e40!important;color:#e6f1fc!important;border-color:#345064!important;
}
#cc-hub #tb_oponentes>tr:nth-child(even)>td,#cc-hub #cc-sparring-opponents>tr:nth-child(even)>td{
 background:#1c354a!important;
}
#cc-hub #tb_oponentes>tr:hover>td,#cc-hub #cc-sparring-opponents>tr:hover>td{background:#25483f!important}
#cc-hub #cc-sparring-opponents>tr>td:first-child{color:#b7cddd!important;font-size:13px;font-weight:700}
#cc-hub .cc-panel thead th{background:#20364d!important;color:#dcebf9!important;border-color:#385269!important}
#cc-hub .cc-panel .text-muted{color:#bcd0e2!important}
/* Opciones: composición compacta con controles oscuros y acciones claras. */
#cc-hub #cfg_panel .cfg_head{background:transparent!important;border-bottom:1px solid #375168!important;padding:2px 0 14px!important;font:750 18px/1.4 system-ui!important;min-height:44px!important}
#cc-hub #cfg_panel #cfg_close{background:#20374c!important;color:#cbddeb!important;border:1px solid #4c667d!important;border-radius:10px!important;width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;font-size:18px!important;box-shadow:none!important}
#cc-hub #cfg_panel .cfg_body{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:12px!important;padding:16px 0!important}
#cc-hub #cfg_panel .cfg_body>.row{margin:0!important;padding:14px!important;border:1px solid #38546c!important;border-radius:13px!important;background:#182f44!important;min-width:0!important}
#cc-hub #cfg_panel .cfg_body>.row:has(#cfg_time_preset),#cc-hub #cfg_panel .cfg_body>.row:has(#cfg_swatches){grid-column:1/-1}
#cc-hub #cfg_panel label{color:#c3d7e8!important;font:700 13px/1.4 system-ui!important;margin:0 0 8px!important;letter-spacing:.015em!important}
#cc-hub #cfg_panel select,#cc-hub #cfg_panel .form-control{background:#102236!important;color:#eef7ff!important;border:1px solid #4b657d!important;border-radius:10px!important;min-height:44px!important;height:auto!important;padding:10px 12px!important;font:400 16px/1.4 system-ui!important;box-shadow:none!important;outline:none;max-width:100%;text-overflow:ellipsis}
#cc-hub #cfg_panel select:focus-visible{outline:2px solid #91c9af!important;outline-offset:2px!important;border-color:#91c9af!important}
#cc-hub #cfg_panel option,#cc-hub #cfg_panel optgroup{background:#102236!important;color:#eef7ff!important}
#cc-hub #cfg_panel .radios{display:flex!important;gap:8px!important;flex-wrap:wrap!important}
#cc-hub #cfg_panel .radios label{display:flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;flex:1 1 90px!important;min-height:44px!important;margin:0!important;padding:9px 10px!important;border:1px solid #4b657d!important;border-radius:10px!important;background:#102236!important;color:#c4d8e9!important;cursor:pointer}
#cc-hub #cfg_panel .radios label:has(input:checked){background:#245247!important;border-color:#83bb9f!important;color:#effff5!important}
#cc-hub #cfg_panel .radios label:focus-within{outline:2px solid #ecd38a;outline-offset:2px}
#cc-hub #cfg_panel .radios input[type=radio]{appearance:auto!important;position:static!important;display:inline-block!important;width:14px!important;min-width:14px!important;max-width:14px!important;height:14px!important;min-height:14px!important;max-height:14px!important;flex:0 0 14px!important;transform:none!important;padding:0!important;margin:0!important;accent-color:#9de0b9}
#cc-hub #cfg_panel .swatches{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:8px!important;margin:0!important}
#cc-hub #cfg_panel .swatches .sw{height:32px!important;min-height:32px!important;border-radius:8px!important;border:1px solid #7591a5!important;box-shadow:none!important;overflow:hidden;transition:box-shadow .15s}
#cc-hub #cfg_panel .swatches .sw:hover{box-shadow:0 0 0 2px #91c9af!important}
#cc-hub #cfg_panel .foot{padding:14px 0 0!important;margin:0!important;border-top:1px solid #375168!important;gap:10px!important}
#cc-hub #cfg_panel #cfg_save,#cc-hub #cfg_panel #cfg_cancel{min-height:44px!important;border-radius:11px!important;padding:11px 16px!important;font:750 14px/1.4 system-ui!important;box-shadow:inset 0 1px #ffffff12!important;transform:none!important}
#cc-hub #cfg_panel #cfg_save{color:#effff6!important;background:linear-gradient(135deg,#326e5e,#214c43)!important;border:1px solid #6fa88f!important}
#cc-hub #cfg_panel #cfg_cancel{color:#c8dceb!important;background:#20364a!important;border:1px solid #4b657d!important}
@media(max-width:480px){#cc-hub #cfg_panel .cfg_body{grid-template-columns:1fr;gap:10px!important}#cc-hub #cfg_panel .cfg_body>.row{padding:12px!important}#cc-hub #cfg_panel .swatches{grid-template-columns:repeat(5,minmax(0,1fr))!important}#cc-hub #cfg_panel .swatches .sw{height:30px!important;min-height:30px!important}}

/* Tablero y panel lateral en escritorio, con el navegador al 100 %. */
@media (min-width: 992px) {
  body > .container-fluid:has(> .cc-header) {
    max-width: 1660px;
    padding-inline: clamp(18px, 2vw, 36px);
  }

  .cc-header + .row {
    display: grid;
    grid-template-columns: minmax(0, clamp(360px, calc(100dvh - 184px), 53%)) minmax(0, 1fr);
    gap: clamp(18px, 2vw, 32px);
    margin-inline: 0;
  }

  /* Bootstrap añade pseudoelementos de limpieza a .row. */
  .cc-header + .row::before,
  .cc-header + .row::after {
    display: none;
  }

  .cc-header + .row > .col-sm-6 {
    float: none;
    width: auto;
    min-width: 0;
    padding-inline: 0;
  }

  .cc-header + .row #board {
    max-width: none;
  }

  #cc-controles {
    margin-top: 12px;
    gap: 10px;
  }

  #cc-controles #btn-tablas,
  #cc-controles #btn-rendirse,
  .cc-header #btn_configurar,
  .cc-header #btn_salir {
    font-size: 16px;
  }

  .timers {
    margin-block: 12px;
    gap: 8px;
  }

  .timers .t {
    font-size: 17px;
  }

  #cc-hub .cc-hub-tab,
  #cc-hub .table,
  #cc-hub .cc-sparring-identity strong {
    font-size: 16px;
  }

  #cc-hub .cc-sparring-identity small,
  #cc-hub .cc-sparring-elo {
    font-size: 13px;
  }

  #cc-hub .cc-sparring-challenge,
  #cc-hub #btn_refresh_oponentes {
    font-size: 15px;
  }

  #cc-hub .cc-chat-text,
  #cc-hub .cc-chat-input,
  #cc-hub .cc-chat-send {
    font-size: 17px;
  }
}

/* Barras de desplazamiento del panel integrado. */
#cc-hub :is(.cc-panel, .cc-chat-messages) {
  scrollbar-color: #679d92 #15283a;
  scrollbar-width: thin;
}

@supports not (scrollbar-color: auto) {
  #cc-hub :is(.cc-panel, .cc-chat-messages)::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  #cc-hub :is(.cc-panel, .cc-chat-messages)::-webkit-scrollbar-track {
    background: #15283a;
  }

  #cc-hub :is(.cc-panel, .cc-chat-messages)::-webkit-scrollbar-thumb {
    background: #679d92;
    border: 2px solid #15283a;
    border-radius: 8px;
  }
}

#cc-hub.cc-hide-chat-badges :is(.cc-hub-unread, .cc-chat-badge) {
  display: none !important;
}

#cc-hub #cfg_panel .cc-chat-badge-options {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

#cc-hub #cfg_panel .cc-chat-badge-switch {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 8px;
  width: 84px;
  min-height: 44px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid #59728c;
  border-radius: 999px;
  background: #192c40;
  color: #e1ecf8;
  box-shadow: none;
  transform: none;
  font: 750 13px/1 system-ui, sans-serif;
}

#cc-hub #cfg_panel .cc-chat-badge-switch::before {
  content: "";
  flex: 0 0 18px;
  height: 18px;
  border-radius: 50%;
  background: #bed1e4;
}

#cc-hub #cfg_panel .cc-chat-badge-switch[aria-checked="true"] {
  flex-direction: row-reverse;
  border-color: #78bba5;
  background: #245348;
  color: #edfff7;
}

#cc-hub #cfg_panel .cc-chat-badge-switch[aria-checked="true"]::before {
  background: #a4e2ca;
}

#cc-hub #cfg_panel .cc-chat-badge-switch:focus-visible {
  outline: 2px solid #ecd38a;
  outline-offset: 3px;
}

/* Las muestras son botones accesibles con dos mitades de color. */
#cc-hub #cfg_panel #cfg_swatches > button.sw {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  transform: none;
}

#cc-hub #cfg_panel #cfg_swatches > button.sw > i {
  display: block;
  flex: 1 0 0%;
  min-width: 0;
}

#cc-hub #cfg_panel .cfg_body > :is(.cfg-match-setup, .cfg-theme-row) {
  grid-column: 1 / -1;
}

#cc-hub #cfg_panel .cfg-match-setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

/* Los pseudoelementos de Bootstrap no deben ocupar celdas de la cuadrícula. */
#cc-hub #cfg_panel .cfg-match-setup::before,
#cc-hub #cfg_panel .cfg-match-setup::after {
  content: none;
  display: none;
}

#cc-hub #cfg_panel .cfg-match-setup > .row {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
}

#cc-hub #cfg_panel .cfg-match-setup > .row:has(#cfg_time_preset) {
  grid-column: 1 / -1;
}

#cc-hub #cfg_panel #cfg_swatches > button.sw {
  padding: 0 !important;
}

#cc-hub { container-type: inline-size; }

@container (max-width: 440px) {
  #cc-hub #cfg_panel .cfg-match-setup { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  #cc-hub #cfg_panel .cfg-match-setup { grid-template-columns: minmax(0, 1fr); }
}
