/* Estilos do módulo social / jogo online (Fase 2). Usa as variáveis de cor de app.css. */

/* Nome de jogador como link para o perfil */
a.plink { color: inherit; text-decoration: none; font-weight: inherit; }
a.plink:hover { text-decoration: underline; color: var(--accent); }

/* ── Jogar agora ── */
.qp { border: 2px solid var(--brand); }
.qp .card-title { align-items: flex-start; flex-wrap: wrap; }
.qp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.qp-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 78px;
  background: var(--bg-2, var(--bg)); border: 1px solid var(--line-2, var(--line)); border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); font: inherit; padding: 10px 6px; transition: transform .08s, border-color .15s, background .15s;
}
.qp-opt:hover { border-color: var(--brand); background: var(--surface); transform: translateY(-1px); }
.qp-opt:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.qp-opt b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.qp-opt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.qp-opt em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ok); }
.qp-foot { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qp-hint { opacity: .8; }
.qp-search { display: flex; align-items: center; gap: 16px; padding: 12px 4px; }
.qp-spin { width: 34px; height: 34px; border-width: 4px; flex: none; }
.qp-title { font-size: 18px; font-family: var(--font-display); }
@media (max-width: 720px) {
  .qp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qp-search { flex-wrap: wrap; }
}
@media (max-width: 380px) { .qp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.live-row { padding: 5px 0; gap: 8px; border-bottom: 1px solid var(--line); }
.live-row:last-child { border-bottom: 0; }

/* ── Partida: variação de rating, aviso de aborto e chat ── */
.rdiff { font-weight: 700; font-size: 12px; }
.rdiff.up { color: var(--ok); }
.rdiff.down { color: var(--bad); }
.abort-note { margin-top: 10px; padding: 8px 12px; }
.chat-card { padding: 12px 14px; }
.chat-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 600; }
.chat-log { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 14px; }
.chat-msg { padding: 5px 10px; border-radius: 10px; background: var(--bg-2, var(--bg)); align-self: flex-start; max-width: 90%; }
.chat-msg.me { background: var(--info-bg); align-self: flex-end; }
.chat-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-btns .btn { border: 1px solid var(--line-2, var(--line)); }

/* ── Perfil público ── */
.profile-head { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.profile-head p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wrap-row { flex-wrap: wrap; }
.rating-cards { gap: 12px; }
.rating-card { display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; font: inherit; color: var(--text); padding: 16px; }
.rating-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset, var(--shadow); }
.rating-card .l { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.rating-card .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; }
.rating-card .v small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.wdl .w { color: var(--ok); } .wdl .d { color: var(--muted); } .wdl .l { color: var(--bad); }
.res { font-weight: 700; font-size: 13px; }
.res.win { color: var(--ok); } .res.loss { color: var(--bad); } .res.draw { color: var(--muted); } .res.live { color: var(--accent); }
.piece-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #888; vertical-align: -1px; }
.piece-dot.white { background: #fff; } .piece-dot.black { background: #16171a; }
.recent-games td { vertical-align: middle; }

/* ── Amigos ── */
.friend-list { display: flex; flex-direction: column; }
.friend { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.friend:last-child { border-bottom: 0; }
.friend .avatar { position: relative; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2, #bbb); }
.dot.on { background: var(--ok); }
.friend .avatar .dot { position: absolute; right: -1px; bottom: -1px; border: 2px solid var(--surface); }
@media (max-width: 560px) { .friend { flex-wrap: wrap; } }
.wdl { white-space: nowrap; }
