:root {
  /* Lobbyz: o duotone do CS. T = dourado, CT = azul. */
  --bg: #0d1219;
  --panel: #151c27;
  --panel-2: #1c2536;
  --line: #27324a;
  --text: #e8edf5;
  --muted: #8d9ab3;
  --accent: #f2b53c;      /* T */
  --accent-ink: #1a1203;
  --ct: #6f9bff;          /* CT */
  --ct-ink: #06101f;
  --ok: #5fd38d;
  --warn: #f2b53c;
  --info: #6f9bff;
  --off: #6e7a90;
  --bad: #ff6b6b;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
}
h2 { margin: 0 0 12px; font-size: 16px; letter-spacing: .02em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; display: grid; gap: 28px; }

/* topo */
.top { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.auth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth form { display: flex; gap: 6px; }
.me { display: flex; align-items: center; gap: 8px; }

/* controles */
input, select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; min-height: 40px; width: 100%;
}
input:focus-visible, select:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #3a4556; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ok { background: #1f7a3f; border-color: #1f7a3f; }
.btn.danger { color: #ff8a8c; }
.btn.small { min-height: 34px; padding: 0 10px; font-size: 13px; }

/* painéis */
.panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.create { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.create label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; min-height: 1em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.live { font-size: 12px; color: var(--muted); }
.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--off); margin-right: 6px; }
.live.on::before { background: var(--ok); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; grid-column: 1 / -1; }
.card { display: grid; gap: 12px; align-content: start; }
.card.highlight { outline: 2px solid var(--accent); }
.card.dim { opacity: .6; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.card-title { font-weight: 700; word-break: break-word; }
.card-sub { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 10px; border: 1px solid currentColor; white-space: nowrap; }
.pill.open { color: var(--ok); }
.pill.ready_check { color: var(--warn); }
.pill.started { color: var(--info); }
.pill.finished { color: var(--off); }
.pill.cancelled { color: var(--bad); }

.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.player span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player.empty-slot { color: var(--muted); }
.avatar { width: 24px; height: 24px; border-radius: 50%; flex: none; background: var(--panel-2); object-fit: cover; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.mark { margin-left: auto; font-size: 13px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.teams h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.server { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 13px ui-monospace, Consolas, monospace; word-break: break-all; }
.server small { display: block; color: var(--muted); font-family: inherit; margin-bottom: 2px; }
.countdown { font-weight: 700; color: var(--warn); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
details.log { font-size: 12px; color: var(--muted); }
details.log summary { cursor: pointer; }
details.log ol { margin: 6px 0 0; padding-left: 18px; }
.time { font-variant-numeric: tabular-nums; opacity: .7; margin-right: 4px; }

/* menu */
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 20px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }

/* busca de jogadores */
.search { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.search label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 140px; }
.search label.grow { flex: 1 1 220px; }
.players-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.player-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.player-card:hover { border-color: #3a4556; }
.player-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player-card .avatar { border-radius: 12px; width: 56px; height: 56px; }
.player-info { display: grid; gap: 2px; min-width: 0; }
.player-info .card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips.small { margin-top: 4px; gap: 4px; }
.chips.small .chip { font-size: 11px; padding: 1px 8px; }
.more { display: grid; justify-items: center; margin-top: 16px; }

/* formulário de perfil */
.photo-row { display: flex; gap: 16px; align-items: center; }
.photo-row .avatar { border-radius: 16px; }
.photo-actions { display: grid; gap: 8px; min-width: 0; }
.photo-actions p { margin: 0; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.row3 label { min-width: 0; }
.form label.check.privacy { align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.privacy span { display: grid; gap: 2px; }
.privacy small { color: var(--muted); font-size: 12px; }
.danger-zone { border-color: #4a2326; }
.danger-zone h2 { color: #ff8a8c; }
.danger-row { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-row input { max-width: 240px; }

/* links e avisos */
a { color: inherit; }
a.brand, a.me, a.plain { text-decoration: none; }
a.plain:hover, a.small-link:hover { text-decoration: underline; }
.small-link { font-size: 13px; color: var(--muted); }
.notice { background: #2a2110; border: 1px solid #5c4716; color: #ffd98a; border-radius: 10px; padding: 10px 14px; }
.notice a { color: var(--accent); font-weight: 600; }

/* perfil */
main.narrow { max-width: 720px; }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head .avatar { border-radius: 16px; }
.profile-main { display: grid; gap: 8px; min-width: 0; }
.profile-main h1 { margin: 0; font-size: 24px; word-break: break-word; }
.badges, .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.badge, .chip { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; color: var(--muted); }
.badge.good { color: var(--ok); border-color: currentColor; }
.badge.bad { color: var(--bad); border-color: currentColor; }
.chip { color: var(--text); background: var(--panel-2); font-size: 13px; }
.bio { margin: 0; white-space: pre-wrap; word-break: break-word; }
h2.spaced { margin-top: 20px; }
.center { text-align: center; display: grid; gap: 12px; justify-items: center; }
.form { display: grid; gap: 14px; }
.form label, .form legend { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend { padding: 0; margin-bottom: 6px; }
.label-row { display: flex; justify-content: space-between; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: auto; min-height: 0; accent-color: var(--accent); }
textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; width: 100%; resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast.ok { background: #10261a; color: #9be8b4; border-color: #1f5c38; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px);
  background: #2a1517; color: #ffb4b6; border: 1px solid #5c2326;
  border-radius: 10px; padding: 10px 16px; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .nav { order: 3; width: 100%; margin: 0; }
  .row3 { grid-template-columns: 1fr; }
  .photo-row { flex-direction: column; align-items: flex-start; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .create { grid-template-columns: 1fr 1fr; }
  .create label:first-child { grid-column: 1 / -1; }
  .create .btn { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* ===================== Lobbyz: camada de tema ===================== */
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 92% -8%, rgba(111, 155, 255, .12), transparent 60%),
    radial-gradient(800px 420px at -4% 0%, rgba(242, 181, 60, .08), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
}

h1, h2, .brand, .nav a, .btn, .card-title, .pill, .teams h3, .readout dt, .eyebrow { font-family: var(--display); }
h2 { font-size: 22px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 14px; }

/* topo: a linha dupla T | CT é a assinatura */
.top { border-bottom: 0; background: rgba(21, 28, 39, .92); backdrop-filter: blur(6px); }
.top::after { content: ""; display: block; height: 3px; background: linear-gradient(104deg, var(--ct) 0 50%, var(--accent) 50% 100%); }
.brand { font-size: 26px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 0; background: none; display: block; }
.logo svg { display: block; width: 100%; height: 100%; }
.tag { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; border-radius: 3px; padding: 4px 6px; }
.nav a { font-size: 18px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: 0; padding: 8px 12px 6px; }
.nav a:hover { background: none; color: var(--text); box-shadow: inset 0 -2px 0 var(--line); }
.nav a[aria-current="page"] { background: none; box-shadow: inset 0 -3px 0 var(--accent); }
.me strong { font-family: var(--display); font-size: 18px; letter-spacing: .03em; }

/* botões: cantos retos e um canto chanfrado no principal */
.btn { font-size: 17px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 3px; }
.btn.small { font-size: 15px; }
.btn.primary { border-radius: 0; padding-right: 20px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.btn.ok { background: #1f7a4c; border-color: #1f7a4c; }
input, select, textarea { border-radius: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible { outline-color: var(--accent); }
.check input, input[type=checkbox] { accent-color: var(--accent); }

/* painéis e cartões */
.panel, .card { border-radius: 4px; }
.card { border-left: 3px solid var(--line); }
.card:has(.pill.open) { border-left-color: var(--ok); }
.card:has(.pill.ready_check) { border-left-color: var(--accent); }
.card:has(.pill.started) { border-left-color: var(--ct); }
.card:has(.pill.cancelled) { border-left-color: var(--bad); }
.card-title { font-size: 24px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; }
.card-sub, .time, .live, .server { font-family: var(--mono); font-size: 12px; }
.card-sub { color: var(--muted); }
.pill { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; border-radius: 3px; padding: 5px 8px; }
.pill.ready_check { animation: pulse 1.4s ease-in-out infinite; }
.countdown { font-family: var(--display); font-size: 22px; letter-spacing: .04em; color: var(--accent); }
.avatar { border-radius: 4px; }
.profile-head .avatar, .photo-row .avatar { border-radius: 6px; }
.player-card .avatar { border-radius: 6px; }
.empty { border-radius: 4px; }

/* times: T e CT com as cores do jogo */
.teams h3 { font-size: 16px; letter-spacing: .1em; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 2px solid var(--line); }
.team-t h3 { color: var(--accent); border-bottom-color: var(--accent); }
.team-ct h3 { color: var(--ct); border-bottom-color: var(--ct); }
.server { border-radius: 3px; border-left: 3px solid var(--ct); }

/* ao vivo: ping de radar */
.live::before { position: relative; }
.live.on::before { background: var(--ok); box-shadow: 0 0 0 0 rgba(95, 211, 141, .6); animation: ping 2s ease-out infinite; }

/* painel de abertura da home */
.board { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: end; padding: 8px 0 4px; }
.eyebrow { margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ct); }
.board h1 { margin: 0; font-size: clamp(44px, 7vw, 76px); line-height: .92; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.board h1 span { display: block; color: var(--accent); }
.board p.lede { margin: 14px 0 0; max-width: 46ch; color: var(--muted); font-size: 17px; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; overflow: hidden; }
.readout div { padding: 14px 16px 12px; border-left: 1px solid var(--line); }
.readout div:first-child { border-left: 0; }
.readout dt { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.readout dd { margin: 0; font: 800 54px/1 var(--display); font-variant-numeric: tabular-nums; }
.readout div:nth-child(1) dd { color: var(--ct); }
.readout div:nth-child(2) dd { color: var(--accent); }

@keyframes pulse { 50% { opacity: .55; } }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(95, 211, 141, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 211, 141, 0); } }
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; gap: 18px; }
  .readout dd { font-size: 42px; }
  .brand { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .pill.ready_check, .live.on::before { animation: none; }
}

/* local: bandeira + texto, no estilo do perfil da Steam */
.loc { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; line-height: 1.2; }
.loc .flag { width: 20px; height: 15px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); object-fit: cover; }
.loc.small { font-size: 13px; color: var(--muted); gap: 6px; }
.loc.small .flag { width: 16px; height: 12px; }

/* perfil: o nick manda; local e função ficam menores, nessa ordem */
.profile-main { gap: 4px; }
.profile-main h1 { font-size: 34px; line-height: 1.05; letter-spacing: .02em; }
.profile-main .loc.small { font-size: 13px; color: var(--text); opacity: .85; }
.profile-main .loc.small .flag { width: 18px; height: 13px; }
.profile-main .badges { margin-top: 6px; }

/* links para outras plataformas (logo + nome) */
.ext-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ext-link { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: var(--text); text-decoration: none; font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.ext-link img { width: 20px; height: 20px; border-radius: 3px; }
.ext-link:hover { border-color: var(--accent); }
.ext-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ext-arrow { color: var(--muted); font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 label { min-width: 0; }
@media (max-width: 720px) { .row2 { grid-template-columns: 1fr; } }
.ext-link img { box-sizing: content-box; padding: 3px; background: #f4f6fa; border-radius: 5px; }

/* disponibilidade: grade dia × período */
.av-grid { display: grid; gap: 4px; max-width: 520px; }
.av-row { display: grid; grid-template-columns: 92px repeat(4, 1fr); gap: 4px; align-items: center; }
.av-head { margin-bottom: 2px; }
.av-col { display: grid; text-align: center; line-height: 1.15; }
.av-col b { font: 600 14px var(--display); letter-spacing: .05em; text-transform: uppercase; }
.av-col small { color: var(--muted); font: 11px var(--mono); }
.av-day { font: 600 15px var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.av-cell { display: block; height: 30px; min-height: 0; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); }
.av-cell.on { background: var(--accent); border-color: var(--accent); }
.av-grid.editable .av-cell { cursor: pointer; }
.av-grid.editable .av-cell:hover { border-color: var(--accent); }
.av-grid.editable .av-cell:focus-visible { outline: 2px solid var(--ct); outline-offset: 2px; }
@media (max-width: 720px) { .av-row { grid-template-columns: 70px repeat(4, 1fr); } .av-col small { display: none; } }

/* objetivos e selos novos */
.badge.goal { color: var(--ct); border-color: currentColor; }
.badge.goal.team { color: var(--accent); }
.chip.goal { color: var(--accent); border-color: currentColor; background: none; }
.roles strong { color: var(--text); font-weight: 600; }
.row3.roles-row { grid-template-columns: repeat(3, 1fr); }
.row2 { align-items: start; }
.form fieldset.goals .checks { grid-template-columns: 1fr; gap: 6px; }
