/* Hop nhom Yana — mot bo mau, hai man hinh (chon phong + dang hop).
   Do tren 5 co may: 1440 · 1280 · 768 · 390 · 375. Moc doi bo cuc: 900px. */
:root {
  --nen: #10131a;
  --nen2: #171b24;
  --nen3: #1f2530;
  --vien: #2b3341;
  --chu: #e9edf4;
  --mo: #98a2b3;
  --vang: #c9a227;     /* gold nhan dien Yana */
  --vang-sang: #e3bf46;
  --do: #e04747;
  --xanh: #2fa36b;
  --bong: 0 6px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--nen); color: var(--chu);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .55; cursor: not-allowed; }
.an { display: none !important; }

/* ───────────────────────────────── man chung (dang nhap · chon phong) */
.khung {
  max-width: 920px; margin: 0 auto; padding: 24px 16px 96px;
}
.dinh {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--vien);
  position: sticky; top: 0; background: var(--nen); z-index: 20;
}
.dinh h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.dinh .logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--vang), #8a6d12);
  display: grid; place-items: center; font-size: 17px;
}
.dinh .day { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dinh .toi { color: var(--mo); font-size: 13px; }

.the {
  background: var(--nen2); border: 1px solid var(--vien);
  border-radius: 14px; padding: 18px; margin-bottom: 14px;
}
.the h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.the p.mo { margin: 0 0 14px; color: var(--mo); font-size: 13.5px; line-height: 1.5; }

label.o { display: block; margin-bottom: 12px; }
label.o span { display: block; font-size: 13px; color: var(--mo); margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--vien); background: var(--nen3); color: var(--chu);
}
input:focus { outline: 2px solid var(--vang); outline-offset: 1px; }

.nut {
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0;
  background: var(--vang); color: #16130a; font-weight: 600;
}
.nut.phu { background: var(--nen3); color: var(--chu); border: 1px solid var(--vien); }
.nut.do { background: var(--do); color: #fff; }
.nut.rong { width: 100%; }

.loi {
  background: rgba(224, 71, 71, .12); border: 1px solid rgba(224, 71, 71, .45);
  color: #ffb4b4; padding: 11px 13px; border-radius: 10px;
  font-size: 13.5px; margin-bottom: 12px; line-height: 1.5;
}

.dsphong { display: grid; gap: 10px; }
.phong {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--nen3); border: 1px solid var(--vien); border-radius: 11px;
}
.phong .ten { font-weight: 600; font-size: 14.5px; }
.phong .duoi { color: var(--mo); font-size: 12.5px; margin-top: 3px; }
.phong .ma { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
             color: var(--vang-sang); letter-spacing: .5px; }
.phong .nut { margin-left: auto; flex: none; }
.trong { color: var(--mo); font-size: 13.5px; padding: 18px 4px; text-align: center; }

/* ───────────────────────────────────────────────── man dang hop */
.hop { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hop .dau {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 10px 14px; background: var(--nen2); border-bottom: 1px solid var(--vien);
}
.hop .dau .ten { font-weight: 600; font-size: 14.5px;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hop .dau .ma { color: var(--mo); font-size: 12px;
                font-family: ui-monospace, Menlo, monospace; }
.hop .dau .phai { margin-left: auto; display: flex; gap: 8px; flex: none; }
.nho {
  min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 12.5px;
  background: var(--nen3); color: var(--chu); border: 1px solid var(--vien);
}

.than { flex: 1; display: flex; min-height: 0; }

.luoi {
  flex: 1; display: grid; gap: 8px; padding: 10px;
  align-content: center; min-height: 0; overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.luoi.mot  { grid-template-columns: 1fr; }
.luoi.chieu { grid-template-columns: 1fr; }

.o {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  aspect-ratio: 4 / 3; border: 2px solid transparent; min-height: 0;
}
.o.noi { border-color: var(--xanh); }
.o video { width: 100%; height: 100%; object-fit: cover; display: block;
           background: #000; }
.o.chieu-lon { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.o.chieu-lon video { object-fit: contain; }
.o .chuC {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--nen3); color: var(--vang-sang);
  font-size: 30px; font-weight: 600;
}
.o .nhan {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, .62); padding: 5px 9px; border-radius: 8px;
  font-size: 12.5px; backdrop-filter: blur(4px);
}
.o .nhan .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o .nhan .dau { flex: none; }
.o .sep { position: absolute; right: 8px; top: 8px; display: flex; gap: 5px; }
.o .sep button {
  width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px;
}

/* cot ben phai: chat + nguoi */
.ben {
  width: 320px; flex: none; border-left: 1px solid var(--vien);
  background: var(--nen2); display: flex; flex-direction: column; min-height: 0;
}
.ben .tabs { display: flex; flex: none; border-bottom: 1px solid var(--vien); }
.ben .tabs button {
  flex: 1; min-height: 42px; background: none; border: 0; color: var(--mo);
  font-size: 13.5px; border-bottom: 2px solid transparent;
}
.ben .tabs button.dang { color: var(--chu); border-bottom-color: var(--vang); }
.ben .ruot { flex: 1; overflow: auto; padding: 12px; min-height: 0; }
.ben .go { flex: none; display: flex; gap: 8px; padding: 10px;
           border-top: 1px solid var(--vien); }
.ben .go input { flex: 1; }

.dong { margin-bottom: 11px; font-size: 13.5px; line-height: 1.45; }
.dong .ai { color: var(--vang-sang); font-weight: 600; font-size: 12.5px; }
.dong.may { color: var(--mo); font-size: 12.5px; font-style: italic; }

.nguoi1 {
  display: flex; align-items: center; gap: 9px; padding: 8px 4px;
  border-bottom: 1px solid var(--vien); font-size: 13.5px;
}
.nguoi1 .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nguoi1 .k { color: var(--mo); font-size: 11.5px; }

.xin {
  background: rgba(201, 162, 39, .12); border: 1px solid rgba(201, 162, 39, .45);
  border-radius: 10px; padding: 11px; margin-bottom: 10px; font-size: 13.5px;
}
.xin .hang { display: flex; gap: 8px; margin-top: 9px; }
.xin .hang button { flex: 1; min-height: 38px; border-radius: 8px; }

/* thanh nut duoi cung */
.chan {
  flex: none; display: flex; justify-content: center; align-items: center;
  gap: 8px; padding: 10px; background: var(--nen2);
  border-top: 1px solid var(--vien); flex-wrap: wrap;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.chan button {
  min-width: 62px; min-height: 46px; border-radius: 11px;
  border: 1px solid var(--vien); background: var(--nen3); color: var(--chu);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; padding: 0 9px;
}
.chan button .bt { font-size: 17px; line-height: 1; }
.chan button.tat { background: var(--do); border-color: var(--do); color: #fff; }
.chan button.bat { background: var(--xanh); border-color: var(--xanh); color: #fff; }
.chan button.roi { background: var(--do); border-color: var(--do); color: #fff; }
.chan button .cham {
  position: absolute; transform: translate(20px, -14px);
  background: var(--do); color: #fff; border-radius: 9px;
  font-size: 10px; padding: 1px 5px; font-weight: 700;
}
.chan button { position: relative; }

.bao {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px;
  background: var(--nen3); border: 1px solid var(--vien); color: var(--chu);
  padding: 11px 16px; border-radius: 11px; font-size: 13.5px; z-index: 60;
  box-shadow: var(--bong); max-width: min(92vw, 460px); text-align: center;
  line-height: 1.45;
}

/* ───────────────────────────── DIEN THOAI — moc 900px, cot ben tut xuong */
@media (max-width: 900px) {
  .ben {
    position: fixed; inset: auto 0 0 0; width: auto; height: 62vh;
    border-left: 0; border-top: 1px solid var(--vien);
    border-radius: 16px 16px 0 0; z-index: 50; box-shadow: var(--bong);
  }
  .ben.an { display: none !important; }
  .luoi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 8px; }
  .o { aspect-ratio: 3 / 4; }
  .hop .dau .ma { display: none; }
  .chan button { min-width: 54px; padding: 0 6px; }
  .khung { padding: 16px 14px 90px; }
}

@media (max-width: 390px) {
  .chan { gap: 6px; }
  .chan button { min-width: 48px; padding: 0 4px; font-size: 9.5px; }
  .chan button .bt { font-size: 16px; }
}
