:root {
  --bg: #f5f2ea; --ink: #1b2130; --mut: #566074; --acc: #1c4a86; --acc2: #123461; --sel: #e2ecf9;
  --card: #ffffff; --line: #c5bfae; --ok: #1a6a3a; --ok-bg: #e5f4ea; --bad: #a02a2a; --bad-bg: #fbe9e9; --bo: #6a5a1a; --bo-bg: #f6f0d9;
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
#app { max-width: 680px; margin: 0 auto; padding: 8px 16px 24px; }
h1, h2, p, ul, blockquote { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid #f0a020; outline-offset: 2px; }
p, li, span, h1, h2, blockquote, button { overflow-wrap: anywhere; }
ruby { ruby-align: center; }
rt { font-size: 0.55em; line-height: 1; padding-bottom: 0.4em; }
/* v2: khe furigana–kanji = 0.4em cỡ rt ≈ 0.22em cỡ chữ gốc (đo ≥3 px ở 16–17 px) */

.man { padding-top: 12px; }
.tieu { font-size: 1.6rem; line-height: 1.25; margin-bottom: 4px; }
.tieu2 { font-size: 1.05rem; margin: 18px 0 6px; }
.phu { color: var(--mut); margin-bottom: 8px; }
.luat { padding-left: 1.2em; margin-bottom: 18px; }
.luat li { margin: 6px 0; }

.nut {
  display: block; width: 100%; min-height: 52px; padding: 10px 16px; border-radius: var(--r);
  border: 2px solid var(--acc); background: var(--card); color: var(--acc2); font-weight: 600;
}
.nut-chinh { background: var(--acc); color: #fff; }
.nut-chinh:disabled { background: #aeb7c6; border-color: #aeb7c6; color: #fff; cursor: default; }
.nut-phu { margin-top: 10px; }
.nut-nho { width: auto; min-height: 44px; padding: 6px 14px; white-space: nowrap; flex: 0 0 auto; }
.nut-xoa { margin-top: 28px; border-color: var(--line); color: var(--mut); font-weight: 400; min-height: 48px; }

.dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.dau-trai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.chip-vong { background: var(--acc); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 700; white-space: nowrap; }
.ten-vong { font-weight: 600; }
.tien { height: 6px; background: #ddd7c8; border-radius: 3px; overflow: hidden; margin: 2px 0 6px; }
.tien-bar { height: 100%; background: var(--acc); }

.ct { display: grid; grid-template-columns: 1fr; gap: 10px; }
.so-cau { color: var(--mut); font-size: 0.9rem; }
.hoi { font-size: 1.2rem; line-height: 1.4; margin: 2px 0 6px; }
.goi-y { color: var(--mut); font-size: 0.92rem; margin-bottom: 6px; }
.goi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin-top: 6px; }
.goi-tieu { color: var(--mut); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.chip-goi { font-size: 0.95rem; margin-top: 8px; line-height: 1.9; }
.chip-tu { font-weight: 700; }

.ops { display: grid; gap: 8px; }
.op {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 14px;
  text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); font-size: 1.05rem;
}
.op.chon { border-color: var(--acc); background: var(--sel); font-weight: 700; }
.op-mau { color: var(--acc); font-size: 1.1rem; flex: 0 0 auto; }
.op-chu { min-width: 0; line-height: 1.9; }
.cuoc { margin-top: 12px; }
.cuoc-tieu { display: block; font-weight: 700; margin-bottom: 6px; }
.cuoc-hang { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bet { min-height: 48px; border: 2px solid var(--line); background: var(--card); border-radius: var(--r); font-weight: 600; }
.bet.chon { border-color: var(--acc); background: var(--acc); color: #fff; }
.nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 6px; grid-column: 1 / -1; }
.nav-trong { display: block; }
.nhac { color: var(--mut); font-size: 0.9rem; text-align: center; grid-column: 1 / -1; }

/* tom tat + mo khoa */
.ds { list-style: none; padding: 0; margin: 10px 0 16px; display: grid; gap: 6px; }
.ds-nut { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.ds-so { flex: 0 0 1.6em; font-weight: 700; color: var(--acc); text-align: center; }
.ds-nd { flex: 1 1 auto; min-width: 0; display: block; }
.ds-hoi { display: block; font-size: 0.88rem; color: var(--mut); line-height: 1.35; }
.ds-chon { display: block; font-weight: 600; line-height: 1.8; }
.ds-chon.trong { color: var(--bad); font-weight: 400; }
.ds-sua { flex: 0 0 auto; color: var(--acc); font-size: 0.85rem; }
.mo { background: var(--card); border: 2px solid var(--acc); border-radius: var(--r); padding: 14px; }
.mo-nhac { color: var(--mut); font-size: 0.92rem; margin-bottom: 10px; }
.mo-nhan { display: block; font-weight: 700; margin-bottom: 4px; }
.mo-o { display: block; width: 100%; min-height: 50px; padding: 8px 12px; font-size: 16px; border: 2px solid var(--line); border-radius: var(--r); background: #fff; }
.mo-loi { min-height: 1.5em; margin: 6px 0; color: var(--bad); font-weight: 600; }

/* ket qua */
.diem { background: var(--acc); color: #fff; border-radius: var(--r); padding: 14px 16px; margin: 8px 0 12px; }
.diem-so { font-size: 2rem; font-weight: 800; line-height: 1.2; }
.diem-phu { opacity: 0.95; }
.diem-vong { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.95rem; }
.loc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.loc-nut { min-height: 48px; border: 2px solid var(--line); background: var(--card); border-radius: var(--r); font-weight: 600; }
.loc-nut.chon { border-color: var(--acc); background: var(--sel); color: var(--acc2); }
.kq-ds { display: grid; gap: 12px; }
.hang { background: var(--card); border: 1px solid var(--line); border-left-width: 6px; border-radius: var(--r); padding: 10px 12px; }
.hang.dung { border-left-color: var(--ok); }
.hang.sai { border-left-color: var(--bad); }
.hang.bo { border-left-color: var(--bo); }
.hang-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; }
.hang-so { font-weight: 700; }
.huy { border-radius: 999px; padding: 1px 10px; font-weight: 700; font-size: 0.9rem; }
.huy-dung { background: var(--ok-bg); color: var(--ok); }
.huy-sai { background: var(--bad-bg); color: var(--bad); }
.huy-bo { background: var(--bo-bg); color: var(--bo); }
.hang-diem { margin-left: auto; font-weight: 700; }
.hang-hoi { color: var(--mut); font-size: 0.92rem; margin-bottom: 6px; }
.dong { margin: 3px 0; line-height: 1.9; }
.nh { color: var(--mut); }
.dong-dap .gt { font-weight: 800; }
.dong-doan { font-weight: 700; color: var(--acc2); line-height: 1.5; margin-top: 6px; }
.trich {
  margin-top: 6px; padding: 8px 12px; background: #f1ede1; border-left: 4px solid var(--acc); border-radius: 6px;
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans", "Meiryo", "MS PGothic", sans-serif; line-height: 1.8; font-size: 1rem;
}
.rong { text-align: center; color: var(--mut); padding: 20px 0; }

/* ngang: 2 cot, giu vua man 375 cao */
@media (orientation: landscape) and (max-height: 520px) {
  #app { padding: 4px 16px 16px; }
  .ct { grid-template-columns: 1fr 1fr; gap: 6px 16px; align-items: start; }
  .hoi { font-size: 1.05rem; margin-bottom: 4px; }
  .so-cau { font-size: 0.82rem; }
  .op { min-height: 46px; padding: 4px 12px; font-size: 1rem; }
  .op-chu { line-height: 1.7; }
  .ops { gap: 6px; }
  .cuoc { margin-top: 8px; }
  .cuoc-tieu { display: inline; margin-right: 8px; }
  .cuoc-hang { margin-top: 4px; }
  .bet { min-height: 46px; }
  .nut { min-height: 48px; padding: 6px 16px; }
  .dau { min-height: 44px; }
  .nhac { display: none; }
  .goi { padding: 4px 10px; margin-top: 4px; }
  .chip-goi { margin-top: 4px; line-height: 1.7; }
}
@media (min-width: 700px) {
  .tieu { font-size: 1.9rem; }
}
