/* chung.css — nền chung của OneDDH Flow: màu, chữ, nút, sảnh, chọn vai, dải kết nối, trang tổng tạm. */
:root {
  color-scheme: light;
  --xanh: #1B75BB;
  --xanh-dam: #145A91;
  --xanh-nhat: #E3EFF9;
  --ngoc: #17A398;
  --ngoc-dam: #0F7D74;
  --ngoc-nhat: #E0F4F2;
  --cam: #F5A623;
  --cam-dam: #8A5A00;
  --cam-nhat: #FFF3DE;
  --do: #C62828;
  --do-nhat: #FDECEC;
  --nen: #F4F7FA;
  --chu: #13202B;
  --chu-phu: #4A5B6B;
  --the: #FFFFFF;
  --vien: #D6DFE8;
  --bo: 14px;
  --bong: 0 1px 2px rgba(19, 32, 43, .06), 0 4px 14px rgba(19, 32, 43, .07);
  --phong: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--nen); color: var(--chu); }
body {
  font-family: var(--phong); font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%; overflow-x: hidden; min-height: 100vh;
  display: flex; flex-direction: column;
}
.goc { flex: 1; width: 100%; }
.dang-nap { padding: 40px 16px; text-align: center; color: var(--chu-phu); background: var(--nen); }
button, input, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--xanh); }
.an { display: none !important; }

.chan-trang {
  padding: 14px 16px 18px; text-align: center; font-size: 13px; color: var(--chu-phu); background: var(--nen);
  border-top: 1px solid var(--vien);
}

/* ---------- Nút chung ---------- */
.nut {
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 2px solid transparent;
  font-weight: 650; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--xanh); color: #fff; transition: transform .08s ease, background .15s ease;
}
.nut:active { transform: scale(.97); }
.nut:disabled { background: #B8C4CF; color: #fff; cursor: not-allowed; }
.nut-ngoc { background: var(--ngoc-dam); color: #fff; }
.nut-cam { background: var(--cam); color: #2B1C00; }
.nut-do { background: var(--do); color: #fff; }
.nut-vien { background: var(--the); color: var(--xanh-dam); border-color: var(--xanh); }
.nut-nhat { background: var(--xanh-nhat); color: var(--xanh-dam); }
.nut-rong { width: 100%; }

/* ---------- Sảnh ---------- */
.sanh { max-width: 560px; margin: 0 auto; padding: 28px 16px 24px; }
.sanh-dau { text-align: center; margin-bottom: 22px; }
.sanh-logo {
  width: 64px; height: 64px; border-radius: 18px; background: var(--xanh); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: var(--bong);
}
.sanh h1 { font-size: 30px; margin: 12px 0 4px; letter-spacing: -.5px; color: var(--chu); background: transparent; }
.sanh-phu { color: var(--chu-phu); margin: 0; font-size: 16px; }
.hop {
  background: var(--the); color: var(--chu); border-radius: 16px; box-shadow: var(--bong);
  padding: 18px; margin-bottom: 14px; border: 1px solid var(--vien);
}
.hop h2 { margin: 0 0 6px; font-size: 19px; }
.hop p { margin: 0 0 12px; color: var(--chu-phu); }
.o-ma {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.o-ma input {
  flex: 1 1 160px; min-width: 0; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--vien);
  background: #fff; color: var(--chu); font-size: 24px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
}
.o-ma input::placeholder { color: #9AA8B5; letter-spacing: 2px; font-weight: 500; }
.o-ma input:focus { outline: 3px solid var(--xanh-nhat); border-color: var(--xanh); }
.loi-nho { color: var(--do); background: transparent; font-size: 14px; margin-top: 8px; min-height: 1em; }
.sanh-gioi-thieu { font-size: 15px; color: var(--chu-phu); }
.sanh-gioi-thieu ol { padding-left: 20px; margin: 6px 0 0; }
.sanh-gioi-thieu li { margin-bottom: 4px; }

/* ---------- Chọn vai ---------- */
.chon-vai { max-width: 980px; margin: 0 auto; padding: 18px 16px 24px; }
.chon-vai-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chon-vai-dau h1 { font-size: 22px; margin: 0; }
.ma-phong {
  display: inline-block; padding: 4px 10px; border-radius: 10px; background: var(--xanh-nhat); color: var(--xanh-dam);
  font-weight: 800; letter-spacing: 2px;
}
.luoi-vai { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.o-vai {
  position: relative; text-align: left; min-height: 92px; padding: 14px 14px 12px; border-radius: 14px;
  border: 2px solid var(--vien); background: var(--the); color: var(--chu); box-shadow: var(--bong);
  display: flex; flex-direction: column; gap: 2px;
}
.o-vai:hover, .o-vai:focus-visible { border-color: var(--xanh); }
.o-vai .bt { font-size: 26px; line-height: 1; }
.o-vai .ten { font-weight: 750; font-size: 17px; }
.o-vai .mo { color: var(--chu-phu); font-size: 14px; }
.o-vai .so-may {
  position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: var(--ngoc-nhat); color: var(--ngoc-dam);
}
.o-vai.dieu-hanh { border-color: var(--xanh); background: var(--xanh-nhat); color: var(--chu); grid-column: 1 / -1; }
.goi-y-vai { color: var(--chu-phu); margin: 0 0 12px; }
.ve-sanh { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }

/* ---------- Dải kết nối ---------- */
.dai-ket-noi {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 50; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 650; box-shadow: var(--bong);
  background: var(--chu); color: #fff;
}
.dai-ket-noi.mat { background: var(--do); color: #fff; }
.dai-ket-noi.cham { background: var(--cam); color: #2B1C00; }
.cham-kn { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ngoc); vertical-align: middle; }
.cham-kn.cham { background: var(--cam); }
.cham-kn.mat { background: var(--do); }

/* ---------- Thông báo nhanh ---------- */
.thong-bao {
  /* Nằm ở đáy màn hình để không đè lên tên vai và mã phòng ở đầu trang. */
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; width: min(520px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 14px; background: var(--chu); color: #fff; box-shadow: var(--bong); font-weight: 600;
  animation: tbVao .2s ease;
}
@keyframes tbVao { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Trang tổng tạm (chỉ dùng khi tong.js chưa có) ---------- */
.tam { max-width: 1400px; margin: 0 auto; padding: 16px; }
.tam-dau { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tam-dau h1 { font-size: 22px; margin: 0; }
.tam-ghi { font-size: 13px; color: var(--cam-dam); background: var(--cam-nhat); padding: 4px 10px; border-radius: 8px; }
.tam-so { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tam-so .o { background: var(--the); color: var(--chu); border-radius: 14px; padding: 12px 14px; box-shadow: var(--bong); }
.tam-so .gt { font-size: 28px; font-weight: 800; color: var(--xanh-dam); background: transparent; }
.tam-so .nh { font-size: 13px; color: var(--chu-phu); }
.tam-dk { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.tam-dk .nut { min-height: 44px; font-size: 15px; padding: 8px 14px; }
.tam-dong { display: grid; grid-template-columns: repeat(10, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.tam-cot { background: #E9EFF5; color: var(--chu); border-radius: 12px; padding: 8px; min-height: 140px; }
.tam-cot.nghen { background: var(--cam-nhat); outline: 2px solid var(--cam); }
.tam-cot h3 { font-size: 14px; margin: 0 0 6px; display: flex; justify-content: space-between; }
.tam-the { background: var(--the); color: var(--chu); border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; font-size: 13px; box-shadow: var(--bong); border-left: 4px solid var(--xanh); }
.tam-the.dang-lam { border-left-color: var(--ngoc); }
.tam-the.bi-chan { border-left-color: var(--do); background: var(--do-nhat); }
.tam-the b { display: block; }
.tam-hai { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tam-hop { background: var(--the); color: var(--chu); border-radius: 14px; padding: 12px 14px; box-shadow: var(--bong); }
.tam-hop h2 { font-size: 16px; margin: 0 0 8px; }
.tam-hop ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.tam-hop li { padding: 6px 0; border-bottom: 1px solid var(--vien); font-size: 14px; }
.tam-hop .phut { color: var(--ngoc-dam); font-weight: 700; }
@media (max-width: 760px) {
  .tam-dong { grid-template-columns: 1fr; overflow: visible; }
  .tam-hai { grid-template-columns: 1fr; }
  .sanh h1 { font-size: 26px; }
}
