/* assets/css/profile.css
 * HUD Dashboard — section #about (PLAYER // PROFILE)
 * Tách riêng khỏi style.css để sau này /about.html dùng lại nguyên khối.
 * Màu lấy từ biến có sẵn trong style.css (--card, --card-2, --line,
 * --text, --text-muted, --chip-bg, --hud, --accent, --accent-2, --bg-rail)
 * nên tự đổi theo theme sáng/tối. KHÔNG dùng biến không tồn tại.
 * Author: bluemanhst
 */

/* ---------- Khung chung ---------- */
.profile-hud {
  /* biến cục bộ dùng lại nhiều lần bên dưới */
  --hud-tint: rgba(47, 123, 255, .12);

  position: relative;
  padding: 20px 22px 24px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--hud-tint), transparent 38%),
    var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

html[data-theme="light"] .profile-hud {
  --hud-tint: rgba(2, 132, 199, .10);
}

/* Vân quét ngang kiểu HUD */
.profile-hud::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, .022) 0 1px,
    transparent 1px 4px
  );
}

.hud-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Badge trạng thái ---------- */
.hud-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  color: var(--text);
  background: var(--chip-bg);
}

.hud-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  animation: hudPulse 2.4s ease-out infinite;
}

.hud-status[data-status="away"] .hud-status-dot { background: #ffc53d; }
.hud-status[data-status="offline"] .hud-status-dot { background: #8a94b0; animation: none; }

@keyframes hudPulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* ---------- Bố cục 2 cột: DANH TÍNH | CHỈ SỐ ---------- */
.hud-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 240px) 1fr;
  gap: 26px;
  padding-top: 20px;
}

/* ---------- Cột trái: DANH TÍNH ---------- */
.hud-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.hud-avatar {
  width: 92px;
  height: 92px;
  margin-bottom: 10px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--hud-tint);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text);
  box-shadow: 0 0 26px var(--hud-tint);
}

.hud-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hud-name { margin: 0; font-size: 1.28rem; font-weight: 800; color: var(--text); }
.hud-tagline { margin: 2px 0 0; font-size: .8rem; line-height: 1.5; color: var(--text-muted); }

.hud-platform {
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.hud-more {
  margin-top: 14px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--hud);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}

.hud-more:hover { border-bottom-color: currentColor; }
.hud-more[hidden] { display: none; }

/* ---------- Cột phải: CHỈ SỐ ---------- */
.hud-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.hud-block {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
}

.hud-block-label {
  margin: 0 0 9px;
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===== STATS ===== */
.hud-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hud-metric {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  text-align: center;
}

.hud-metric-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hud-metric-label {
  display: block;
  margin-top: 3px;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--text-muted);
}

/* ===== CLASS / ROLE / STYLE ===== */
.hud-classes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hud-class {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--hud);
  border-radius: 10px;
  background: var(--card-2);
  min-width: 0;
}

.hud-class-key {
  display: block;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-muted);
}

.hud-class-val {
  display: block;
  margin-top: 2px;
  font-size: .86rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ===== LEVEL / EXP ===== */
.hud-level-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-muted);
}

.hud-level-top b {
  font-size: .92rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hud-expbar {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-rail);
  overflow: hidden;
}

.hud-expbar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .5s ease;
}

/* ===== SKILLS ===== */
.hud-skills { display: flex; flex-wrap: wrap; gap: 7px; }

.hud-skill {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: .76rem;
  font-weight: 600;
  color: var(--text);
}

.hud-empty { font-size: .78rem; color: var(--text-muted); }

/* ===== FOCUS ===== cắt còn 4 dòng nên cao luôn cố định */
.hud-focus {
  position: relative;
  margin: 0;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  font-size: .84rem;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  min-height: calc(1.65em * 4 + 24px);
}

.hud-focus::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--hud);
}

.hud-focus[hidden] { display: none; }

/* ---------- Thu hẹp: xuống 1 cột ---------- */
@media (max-width: 880px) {
  .hud-grid { grid-template-columns: 1fr; gap: 20px; }

  .hud-id {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    text-align: left;
    gap: 6px 14px;
  }

  .hud-avatar { width: 74px; height: 74px; margin-bottom: 0; font-size: 1.35rem; }
  .hud-name { font-size: 1.12rem; }
  .hud-platform, .hud-more { margin-top: 0; }
}

@media (max-width: 560px) {
  .profile-hud { padding: 16px 15px 18px; }
  .hud-classes, .hud-metrics { grid-template-columns: 1fr; }
  .hud-metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
    gap: 10px;
  }
  .hud-metric-label { margin-top: 0; }
  .hud-head { flex-wrap: wrap; }
}

/* Tôn trọng giảm chuyển động của hệ điều hành */
@media (prefers-reduced-motion: reduce) {
  .hud-status-dot { animation: none; }
  .hud-expbar > i { transition: none; }
}

/* ============================================================================
 *  COMMS // OPEN — khối kết trang (thay footer cũ của trang chủ)
 * ---------------------------------------------------------------------------
 *  Cấu trúc: .comms-panel là "tấm kính" bo góc chứa tiêu đề + lưới kênh +
 *  chữ ký. .comms-foot là dải copyright mảnh nằm dưới, tách bằng đường kẻ.
 *  Mọi màu lấy từ token có sẵn trong style.css nên tự đổi theo theme.
 * ============================================================================ */
/* Khối COMMS là section cuối, nằm NGOÀI <main> nên không được rule
   `.section + .section` (anh em) nữa -> tự vẽ đường kẻ ngăn cách. */
.comms-section {
  /* Khối cuối nằm NGOÀI <main> nên không dính rule `.section + .section`
     (anh em) của style.css -> tự vẽ đường kẻ ngăn cách phần nội dung. */
  border-top: 1px solid var(--line);
  /* Bỏ padding-bottom vì dải .comms-foot sát dưới sẽ chồm lên */
  padding-bottom: 0;
  /* Nền tối hơn một chút so với section trên -> tách bạch rõ ranh giới
     "nội dung" và "chân trang", tự nhiên hơn là nhét chung. */
  background: linear-gradient(180deg, transparent, var(--bg-soft) 38%);
}

.comms-panel {
  display: grid;
  gap: 26px;
  padding: 30px 30px 26px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  /* Quét ngang kiểu HUD cho đồng bộ khung #about ở trên */
  position: relative;
  overflow: hidden;
}

.comms-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, .018) 0 1px,
    transparent 1px 4px
  );
}

/* Tiêu đề: nằm trên, chiếm full width — dải kênh ở dưới đọc dễ hơn là
   chia 2 cột như layout cũ. */
.comms-intro { position: relative; }
.comms-intro .hud-line { margin-bottom: 10px; }
.comms-intro .section-title { margin: 0; }
.comms-intro .section-sub { margin: 8px 0 0; }

/* <address> mặc định nghiêng — bỏ đi, kênh liên hệ không nên in nghiêng */
.comms { font-style: normal; }

/* Lưới kênh: 4 cột trên desktop, tự xuống hàng. Ô full-width khi chỉ còn
   1-2 kênh (dữ liệu lấy từ site_config nên số kênh có thể thay đổi). */
.comms .contact-card { position: relative; }

/* ===== THANH ĐÁY =====
   Một dòng duy nhất, 3 vùng: chữ ký (trái) · điều hướng (giữa) · copyright (phải).
   Thay cho dải .comms-foot cũ vốn tách 3 tầng rời rạc và lặp lại "bluemanhst"
   hai lần sát nhau — đó là lý do footer trông thiếu chuyên nghiệp. */
.comms-bar {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.comms-bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  flex-wrap: wrap;
  padding: 20px 0 24px;
}

.comms-sign {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.comms-sign-name { font-weight: 800; color: var(--text); }
.comms-sign-sep { color: var(--hud); opacity: 0.55; }
.comms-sign-role { color: var(--text-muted); }

.comms-nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.comms-nav a {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.comms-nav a:hover,
.comms-nav a:focus-visible { color: var(--accent); }
.comms-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.comms-copy {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Thu hẹp ---------- */
@media (max-width: 880px) {
  .comms-panel { padding: 24px 20px 22px; gap: 22px; }
  .comms { grid-template-columns: 1fr 1fr; }
  /* Bỏ justify-content: space-between để 3 vùng xếp gọn, không bị giãn */
  .comms-bar-in { justify-content: flex-start; gap: 12px 20px; }
  .comms-copy { order: 3; }
}

@media (max-width: 560px) {
  .comms-panel { padding: 20px 16px 18px; border-radius: 14px; }
  .comms { grid-template-columns: 1fr; }
  .comms-sign { font-size: 0.7rem; letter-spacing: 1px; }
  .comms-bar-in { padding: 16px 0 20px; }
  .comms-nav { gap: 4px 14px; }
  .comms-nav a { font-size: 0.8rem; }
}

