/* =====================================================================
   BATALHA PARTY — Rodada 50: janela "Equipe" — abas Minha equipe / Clã (js/ui/screen-team.js; docs/ROUND50-EQUIPE-JANELA.md).
   Moldura = a do Centro de tarefas (css/tasks.css: .tk-backdrop/.tk-wrap/.tk-panel/.tk-ribbon/.tk-close) + dois varões
   dourados com estandartes de clã (SVG) balançando no alto, presos nas pontas da fita. Abas laranja (ativa) / roxa como as
   do E-mail; conteúdo numa caixa clara com a borda de cima laranja; pessoas e clãs em cartões brancos; o clã do jogador num
   cartão roxo com o escudo da TAG. Palco fixo 1280x720 escalado: sem media queries.
   ===================================================================== */
.overlay.team { position: absolute; inset: 0; }
.tw-wrap { width: 1040px; height: 600px; }
.tw-panel { background: #f8f1e1; }

/* ---------------------------------------------------------------- estandartes */
.tw-banners { position: absolute; left: 0; top: 0; width: 100%; height: 84px; z-index: 1; pointer-events: none; overflow: visible; }
.tw-rod { fill: #c98a2e; stroke: #6b3f12; stroke-width: 2; }
.tw-rodhi { fill: #ffe0a0; opacity: .75; }
.tw-knob { fill: #ffd24f; stroke: #8a5a00; stroke-width: 2.2; }
.tw-ban { transform-box: fill-box; transform-origin: 50% 0; animation: tw-sway 3.2s ease-in-out infinite alternate; }
@keyframes tw-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* ---------------------------------------------------------------- corpo */
.tw-body {
  position: absolute; left: 0; right: 0; top: 76px; bottom: 10px; z-index: 2; padding: 0 24px 4px;
  display: flex; flex-direction: column; min-height: 0; color: #5a3a1a;
}
.tw-panel ::-webkit-scrollbar { width: 10px; }
.tw-panel ::-webkit-scrollbar-track { background: transparent; }
.tw-panel ::-webkit-scrollbar-thumb { background: #d9c9a3; border-radius: 5px; border: 2px solid #fbf6ea; }

/* ---------------------------------------------------------------- abas + ações */
.tw-top { flex: none; display: flex; align-items: flex-end; gap: 12px; height: 56px; }
.tw-tabs { display: flex; gap: 6px; align-self: stretch; align-items: flex-end; }
.tw-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 18px 0 12px; border: 0; cursor: pointer;
  border-radius: 14px 14px 0 0; font-family: inherit; font-size: 22px; font-weight: 900; letter-spacing: .2px; color: #fff; white-space: nowrap;
  background: linear-gradient(#a487ff 0%, #8a66f0 45%, #6c47d8 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .15);
  -webkit-text-stroke: 1.2px #2e1478; paint-order: stroke fill; text-shadow: 0 2px 0 #2e1478; transition: filter .12s;
}
.tw-tab:hover { filter: brightness(1.08); }
.tw-tab .ico { flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.tw-tab.on {
  height: 56px; cursor: default; background: linear-gradient(#fff07a 0%, #ffd23c 40%, #ffaa22 100%);
  -webkit-text-stroke: 1.3px #8a3d00; text-shadow: 0 2px 0 #8a3d00;
}
.tw-tab:focus-visible, .tw-tool:focus-visible, .tw-btn:focus-visible { outline: 3px solid #ffb43a; outline-offset: 2px; }
.tw-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.tw-tool {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 2px solid #e6d9bd; background: #fff; color: #7a5326; font-family: inherit; font-size: 16px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 3px 0 rgba(120, 90, 40, .15); transition: transform .06s;
}
.tw-tool:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 90, 40, .15); }
.tw-tool.gold { border: 0; color: #3a1d00; background: linear-gradient(#ffd24a, #ff9c1a); box-shadow: 0 4px 0 #a05a00, 0 6px 8px rgba(0, 0, 0, .15); }
.tw-tool.gold:active:not(:disabled) { box-shadow: 0 1px 0 #a05a00; }
.tw-tool.red {
  border: 0; color: #fff; background: linear-gradient(#ff8f80, #e8453c); box-shadow: 0 4px 0 #9a2a20, 0 6px 8px rgba(0, 0, 0, .15);
  -webkit-text-stroke: 1px #7a1a10; paint-order: stroke fill; text-shadow: 0 1px 0 #7a1a10;
}
.tw-tool.red:active:not(:disabled) { box-shadow: 0 1px 0 #9a2a20; }
.tw-tool.big { height: 50px; padding: 0 22px; font-size: 19px; }
.tw-tool .ico { flex: none; }
.tw-tool:disabled { cursor: wait; filter: grayscale(.4); }

/* ---------------------------------------------------------------- caixa do conteúdo */
.tw-box {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: #fbf6ea; border: 2px solid #ece3cf; border-top: 4px solid #ffaa22; border-radius: 0 16px 16px 16px;
  box-shadow: inset 0 2px 6px rgba(120, 90, 40, .08);
}
.tw-box > * { flex: none; }
.tw-msg { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-size: 20px; font-weight: 800; color: #9a7a4a; }
.tw-msg.err { color: #c0392b; }
.tw-sec { display: flex; align-items: center; gap: 8px; margin: 4px 2px -2px; font-size: 19px; font-weight: 900; color: #5a3a1a; }
.tw-sec .ico { flex: none; }

/* ---------------------------------------------------------------- Minha equipe */
.tw-intro {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border-radius: 14px;
  background: #fff4d6; border: 2px solid #ffd36a; font-size: 17px; font-weight: 800; line-height: 1.3; color: #7a5326;
}
.tw-intro > .ico { flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .15)); }
.tw-intro .tx .ico { vertical-align: -4px; }
.tw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tw-tile {
  height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
  border-radius: 14px; background: linear-gradient(#fffaf0, #fff0d2); border: 2px solid #ecd8ad; box-shadow: 0 3px 0 rgba(150, 110, 40, .18);
}
.tw-tile .v {
  display: flex; align-items: center; gap: 6px; max-width: 100%; font-size: 30px; font-weight: 900; line-height: 1.05; color: #ff9a12; white-space: nowrap;
  -webkit-text-stroke: 1.2px #7a3a00; paint-order: stroke fill; text-shadow: 0 2px 0 rgba(122, 58, 0, .35);
}
.tw-tile.money .v { font-size: 25px; }
.tw-tile .sub { display: inline-flex; align-items: center; gap: 3px; font-size: 15px; color: #8a6234; -webkit-text-stroke: 0; text-shadow: none; }
.tw-tile .k { font-size: 15px; font-weight: 900; color: #8a6234; white-space: nowrap; }
.tw-tile.total { background: linear-gradient(#f4fff2, #dcf6d4); border-color: #a4dcae; }
.tw-tile.total .v { color: #45c235; -webkit-text-stroke-color: #1d6a10; text-shadow: 0 2px 0 rgba(29, 106, 16, .3); }
.tw-tile.total .k { color: #2f7a28; }

/* cartões de pessoas (Minha equipe e membros do clã) */
.tw-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 74px;
  padding: 8px 18px 8px 8px; background: #fff; border: 2px solid #ece3cf; border-radius: 16px; box-shadow: 0 3px 0 rgba(120, 90, 40, .12);
}
.tw-row.off { opacity: .55; }
.tw-row.me { border-color: #ffd36a; background: linear-gradient(90deg, #fff6dc 0%, #ffffff 50%); }
.tw-av { width: 56px; height: 56px; border-radius: 12px; border: 3px solid #7b58da; background: #3b2a6b; overflow: hidden; box-shadow: 0 2px 0 rgba(40, 10, 90, .35); }
.tw-av .ico { display: block; width: 100%; height: 100%; object-fit: cover; }
.tw-info { min-width: 0; }
.tw-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 20px; font-weight: 900; color: #4a2d0e; }
.tw-name .nm { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tw-sub { margin-top: 3px; font-size: 14px; font-weight: 800; color: #a58a5e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-sub .ico { vertical-align: -3px; }
.tw-lvl, .tw-chip { flex: none; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; line-height: 20px; white-space: nowrap; }
.tw-lvl { color: #fff; background: #7b58da; box-shadow: 0 2px 0 rgba(40, 10, 90, .35); }
.tw-lvl.l1 { background: #ff9a12; box-shadow: 0 2px 0 #a05a00; }
.tw-lvl.l2 { background: #3fa9f5; box-shadow: 0 2px 0 #1f6fb0; }
.tw-lvl.l3 { background: #3fbf4f; box-shadow: 0 2px 0 #1f8f3a; }
.tw-lvl.l4 { background: #a25cf0; box-shadow: 0 2px 0 #5a2ba0; }
.tw-lvl.l5 { background: #f0506a; box-shadow: 0 2px 0 #a0203a; }
.tw-chip.lead { background: #ffd24f; color: #6b3300; box-shadow: 0 2px 0 #b07a00; }
.tw-chip.you { background: #e3f8e6; color: #1f7a33; box-shadow: inset 0 0 0 2px #8fdc9c; }
.tw-comm { text-align: right; white-space: nowrap; }
.tw-comm .val { display: inline-flex; align-items: center; gap: 4px; font-size: 21px; font-weight: 900; color: #27a33a; }
.tw-comm .split { margin-top: 2px; font-size: 13px; font-weight: 800; color: #a58a5e; }
.tw-comm .split .ico { vertical-align: -3px; }
.tw-comm .none { font-size: 15px; font-weight: 800; color: #b49a6a; }
.tw-empty { margin: auto; padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 21px; font-weight: 900; color: #8a7a58; }
.tw-empty > .ico { opacity: .55; }
.tw-empty small { font-size: 16px; font-weight: 800; color: #a58a5e; }
.tw-empty .tw-tool { margin-top: 6px; }

/* ---------------------------------------------------------------- Clã: escudo */
.tw-shield { display: block; overflow: visible; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .2)); }
.tw-shield text { font-family: inherit; font-weight: 900; fill: #fff; stroke: #2a1a05; stroke-width: 3.4px; paint-order: stroke fill; letter-spacing: .5px; }
.tw-shield.empty text { fill: #fffaf0; stroke: #b49a6a; }

/* Clã: o clã do jogador */
.tw-head {
  display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 16px 10px 8px; border-radius: 18px;
  background: linear-gradient(135deg, #9a78ff 0%, #7248e8 50%, #5a2fcc 100%); border: 3px solid #3a1f8a;
  box-shadow: 0 4px 0 rgba(40, 10, 90, .35), inset 0 2px 0 rgba(255, 255, 255, .3);
}
.tw-hsh { display: flex; justify-content: center; }
.tw-hmain { min-width: 0; }
.tw-hname {
  font-size: 30px; font-weight: 900; line-height: 1.15; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-text-stroke: 1.3px #2e1478; paint-order: stroke fill; text-shadow: 0 2px 0 #2e1478;
}
.tw-hmeta { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 800; color: #ece4ff; }
.tw-tagchip { padding: 1px 10px; border-radius: 8px; background: rgba(20, 0, 60, .35); color: #ffe08a; font-weight: 900; letter-spacing: 1.5px; }
.tw-role { padding: 1px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); color: #fff; font-weight: 900; }
.tw-role.lead { background: #ffd24f; color: #6b3300; box-shadow: 0 2px 0 #b07a00; }
.tw-hstats { display: flex; gap: 10px; }
.tw-hstat {
  min-width: 118px; height: 74px; padding: 0 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 14px; background: #fffaf0; box-shadow: 0 3px 0 rgba(40, 10, 90, .35), inset 0 0 0 2px #ecd8ad;
}
.tw-hstat .n { display: flex; align-items: center; gap: 6px; }
.tw-hstat b {
  font-size: 23px; font-weight: 900; line-height: 1.1; color: #ff9a12; white-space: nowrap;
  -webkit-text-stroke: 1px #7a3a00; paint-order: stroke fill;
}
.tw-hstat small { font-size: 13px; font-weight: 900; color: #8a6234; }
.tw-tro { display: flex; align-items: center; gap: 6px; }
.tw-tro b {
  font-size: 24px; font-weight: 900; color: #ffb300; white-space: nowrap;
  -webkit-text-stroke: 1.3px #6b3300; paint-order: stroke fill; text-shadow: 0 2px 0 #6b3300;
}

/* Clã: criar */
.tw-create {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 14px; padding: 10px 16px 12px 10px;
  background: #fff; border: 2px dashed #e2cf9f; border-radius: 16px;
}
.tw-crsh { display: flex; justify-content: center; }
.tw-crmain { min-width: 0; }
.tw-crtitle { margin-bottom: 4px; font-size: 21px; font-weight: 900; color: #4a2d0e; }
.tw-crrow { display: flex; align-items: flex-end; gap: 12px; }
.tw-fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tw-fld.nm { flex: 1 1 auto; }
.tw-fld.tg { flex: none; width: 132px; }
.tw-fld > span { margin-left: 4px; font-size: 13px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: #8a6234; }
.tw-input {
  width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 2px solid #e6d9bd; border-radius: 12px; background: #fff; outline: none;
  font-family: inherit; font-size: 19px; font-weight: 900; color: #4a2d0e; box-shadow: inset 0 2px 0 rgba(120, 90, 40, .08);
  -webkit-user-select: text; user-select: text;
}
.tw-input::placeholder { color: #c9b48a; font-weight: 800; }
.tw-input:focus { border-color: #ffb43a; box-shadow: 0 0 0 3px rgba(255, 180, 58, .25); }
#tw-tag { text-transform: uppercase; letter-spacing: 2px; }
.tw-input.bad { border-color: #ff5a5a; box-shadow: 0 0 0 3px rgba(255, 90, 90, .2); animation: tw-shake .3s; }
@keyframes tw-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.tw-crhint { margin-top: 6px; font-size: 13px; font-weight: 800; color: #a58a5e; }
.tw-cfm { display: inline-block; margin-top: 6px; opacity: .8; }

/* botões verdes / azuis / cinza */
.tw-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  cursor: pointer; font-family: inherit; font-size: 19px; font-weight: 900; color: #fff; white-space: nowrap;
  paint-order: stroke fill; transition: transform .06s, filter .1s;
}
.tw-btn .ico { flex: none; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.tw-btn.green {
  background: linear-gradient(#8ef05a 0%, #4fcf2c 55%, #35a81c 100%); -webkit-text-stroke: 1.1px #1d6a10; text-shadow: 0 2px 0 #1d6a10;
  box-shadow: 0 4px 0 #2a7a14, inset 0 2px 0 rgba(255, 255, 255, .4);
}
.tw-btn.blue {
  background: linear-gradient(#7fe3ff 0%, #3fb6f0 55%, #2192d6 100%); -webkit-text-stroke: 1.1px #0d4b7a; text-shadow: 0 2px 0 #0d4b7a;
  box-shadow: 0 4px 0 #15628f, inset 0 2px 0 rgba(255, 255, 255, .4);
}
.tw-btn.gray { background: linear-gradient(#efeff4, #cfcfd8); color: #6a6a78; box-shadow: 0 4px 0 #9a9aa6; cursor: default; }
.tw-btn:hover:not(:disabled) { filter: brightness(1.06); }
.tw-btn:active:not(:disabled) { transform: translateY(3px); }
.tw-btn.green:active:not(:disabled) { box-shadow: 0 1px 0 #2a7a14; }
.tw-btn.blue:active:not(:disabled) { box-shadow: 0 1px 0 #15628f; }
.tw-btn:disabled:not(.gray) { cursor: wait; filter: grayscale(.4); }

/* Clã: buscar + lista */
.tw-search { display: flex; gap: 10px; }
.tw-search .tw-input { flex: 1 1 auto; width: auto; }
.tw-clans { display: flex; flex-direction: column; gap: 8px; transition: opacity .15s; }
.tw-clans.busy { opacity: .5; }
.tw-clans > .tw-msg { margin: 0; padding: 30px 0; }
.tw-clan {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) 100px 120px 128px; align-items: center; gap: 12px; min-height: 74px;
  padding: 6px 14px 6px 8px; background: #fff; border: 2px solid #ece3cf; border-radius: 16px; box-shadow: 0 3px 0 rgba(120, 90, 40, .12);
}
.tw-csh { display: flex; justify-content: center; }
.tw-cstat { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 900; color: #5a3a1a; white-space: nowrap; }
.tw-cstat .ico { flex: none; }
.tw-cstat.tro b { color: #c26a00; }
.tw-clan .tw-btn { width: 128px; padding: 0 10px; }
.tw-none { padding: 26px 10px; text-align: center; font-size: 18px; font-weight: 800; color: #a58a5e; }
