/* HUST Giving — bảng đóng góp trực tiếp (màn chiếu). Một theme duy nhất, nền đỏ đậm. */

:root {
  --lb-bg-1: #5C0B14;
  --lb-bg-2: #8E1220;
  --lb-panel: rgba(255,255,255,.07);
  --lb-panel-2: rgba(255,255,255,.11);
  --lb-line: rgba(255,255,255,.14);
  --lb-text: #FFFFFF;
  --lb-muted: rgba(255,255,255,.66);
  --lb-gold: #F3C108;
  --lb-green: #6EE7B7;
  --f: "Be Vietnam Pro", -apple-system, "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(160deg, var(--lb-bg-1), var(--lb-bg-2) 60%, #6E0E19);
  color: var(--lb-text); font-family: var(--f); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lb-gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.lb { min-height: 100vh; display: flex; flex-direction: column; padding: 18px 26px 14px; gap: 16px; }
/* Màn chiếu: gói trong đúng một màn hình, các bảng tự cắt phần dưới (dòng mới nhất luôn ở trên) */
@media (min-width: 1100px) and (min-height: 700px) {
  .lb { height: 100vh; overflow: hidden; }
  .lb-main { min-height: 0; }
  .panel { overflow: hidden; }
  .panel .list { flex: 1; min-height: 0; overflow: hidden; }
}

/* ---------- thanh trên */
.lb-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lb-top .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.lb-top .brand img { height: 44px; width: auto; background: #fff; border-radius: 3px; padding: 2px; }
.lb-top .brand .t1 { font-weight: 700; font-size: 17px; }
.lb-top .brand .t2 { font-size: 11.5px; color: var(--lb-muted); letter-spacing: .06em; text-transform: uppercase; }
.lb-top .note { font-size: 12.5px; color: var(--lb-muted); margin-left: 8px; }
.lb-top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lb-top .live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 13px; letter-spacing: .04em; }
.lb-top .live .dot { width: 9px; height: 9px; border-radius: 100px; background: var(--lb-green); box-shadow: 0 0 0 0 rgba(110,231,183,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(110,231,183,.7); } 70% { box-shadow: 0 0 0 9px rgba(110,231,183,0); } 100% { box-shadow: 0 0 0 0 rgba(110,231,183,0); } }
.lang-dd { position: relative; }
.lang-dd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--lb-line); border-radius: 3px; background: transparent; color: var(--lb-muted); cursor: pointer; }
.lang-dd .flag { width: 22px; height: 15px; border-radius: 2px; display: block; }
.lang-dd-btn .cur { display: block; line-height: 0; }
.lang-dd-btn .caret { width: 11px; height: 11px; }
.lang-dd-menu { position: absolute; top: calc(100% + 6px); right: 0; margin: 0; padding: 4px; list-style: none; z-index: 60; background: #fff; border-radius: 4px; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.lang-dd-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 2px; background: transparent; cursor: pointer; color: #16191F; font-size: 12px; white-space: nowrap; }
.lang-dd-menu button:hover { background: #EDF1F5; }
.lang-dd-menu li[aria-selected="true"] button { background: #FCEDEF; }

/* ---------- lưới chính */
.lb-main { flex: 1; display: grid; grid-template-columns: minmax(340px, .8fr) 2fr; grid-template-rows: minmax(0, 1fr); gap: 16px; min-height: 0; }
@media (max-width: 1100px) { .lb-main { grid-template-columns: 1fr; grid-template-rows: none; } }

.lb-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.big { display: flex; flex-direction: column; gap: 2px; }
.big .n { font-size: clamp(24px, 2.7vw, 44px); white-space: nowrap; font-weight: 800; letter-spacing: -0.035em; color: var(--lb-gold); font-variant-numeric: tabular-nums; line-height: 1.05; transition: transform .25s ease; }
.big .n.bump { transform: scale(1.03); }
.big .l { font-size: 13.5px; color: var(--lb-muted); letter-spacing: .02em; }
.big.small .n { font-size: clamp(24px, 2.6vw, 38px); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--lb-panel); border: 1px solid var(--lb-line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tile .fn { font-size: 12px; color: var(--lb-muted); line-height: 1.35; min-height: 2.7em; }
.tile .amt { font-size: clamp(15px, 1.25vw, 19px); font-weight: 800; white-space: nowrap; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .cnt { font-size: 12px; color: var(--lb-muted); font-family: var(--f-mono); }
.tile .bar { height: 4px; background: rgba(255,255,255,.14); border-radius: 100px; overflow: hidden; margin-top: 4px; }
.tile .bar i { display: block; height: 100%; background: var(--lb-gold); border-radius: 100px; transition: width .6s ease; }

.qr-card { margin-top: auto; background: #fff; color: #16191F; border-radius: 8px; padding: 16px; display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.qr-card .qr { width: 150px; aspect-ratio: 1; display: grid; place-items: center; }
.qr-card .qr img, .qr-card .qr canvas, .qr-card .qr table { max-width: 100%; height: auto; }
.qr-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.qr-card p { margin: 0; font-size: 13px; color: #5A6472; line-height: 1.5; }
.qr-card .url { font-family: var(--f-mono); font-size: 11.5px; color: #CE1628; margin-top: 8px; word-break: break-all; }
@media (max-width: 480px) { .qr-card { grid-template-columns: 1fr; text-align: center; } .qr-card .qr { margin: 0 auto; } }

/* ---------- cột phải */
/* Màn rộng: ba bảng cạnh nhau, mỗi bảng 10 dòng — không bảng nào đè bảng nào */
.lb-right { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 14px; min-width: 0; min-height: 0; }
@media (max-width: 1100px) { .lb-right { grid-template-columns: 1fr 1fr; grid-template-rows: none; } }
@media (max-width: 760px) { .lb-right { grid-template-columns: 1fr; } }
.panel { background: var(--lb-panel); border: 1px solid var(--lb-line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; min-height: 0; }
.panel.tall { grid-row: auto; }
.panel .ph { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.panel .ph h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lb-gold); }
.tabs { display: inline-flex; gap: 4px; }
.tabs button { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 100px; border: 1px solid var(--lb-line); background: transparent; color: var(--lb-muted); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: #fff; color: #5C0B14; border-color: #fff; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 7px 9px; background: var(--lb-panel-2); border-radius: 5px; font-size: 13.5px; animation: slideIn .45s ease; }
.list li.new { box-shadow: inset 0 0 0 1px var(--lb-gold); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.list .rk { font-family: var(--f-mono); font-size: 12px; color: var(--lb-muted); width: 22px; text-align: right; }
.list .rk.top { color: var(--lb-gold); font-weight: 700; }
.list .av { width: 28px; height: 28px; border-radius: 100px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.list .who { min-width: 0; display: flex; flex-direction: column; }
.list .who .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .who .sub { font-size: 11.5px; color: var(--lb-muted); font-family: var(--f-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .msg { grid-column: 1 / -1; font-size: 12.5px; color: #fff; line-height: 1.45; font-style: italic; }
.list .msg-when { font-size: 11px; color: var(--lb-muted); font-family: var(--f-mono); }
.list li.m { grid-template-columns: auto 1fr auto; }
.list .empty { color: var(--lb-muted); font-size: 13px; padding: 10px; }

/* ---------- ticker dưới cùng */
.ticker { display: flex; align-items: center; gap: 10px; overflow: hidden; border-top: 1px solid var(--lb-line); padding-top: 12px; }
.ticker .lbl { flex: none; background: var(--lb-gold); color: #5C0B14; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 8px 12px; border-radius: 4px; }
.ticker .items { display: flex; gap: 8px; overflow: hidden; }
.ticker .it { flex: none; background: var(--lb-panel-2); border-radius: 4px; padding: 7px 12px; font-size: 12.5px; white-space: nowrap; animation: slideIn .4s ease; }
.ticker .it b { font-weight: 700; }
.ticker .it small { color: var(--lb-muted); font-family: var(--f-mono); font-size: 11px; margin-left: 6px; }
.ticker .foot { margin-left: auto; flex: none; font-size: 11.5px; color: var(--lb-muted); }
.ticker .foot button { background: transparent; border: 1px solid var(--lb-line); color: var(--lb-muted); border-radius: 3px; padding: 4px 9px; font-size: 11px; cursor: pointer; margin-left: 8px; }
@media (max-width: 760px) { .ticker .foot { display: none; } }
