/* v43: trang «🎡 Quay ngách» (public/app-quay.js, docs/SPEC-v43-vong-quay-ngach.md PHAN C).
   Dung bien mau chung cua app.css (--panel, --ink, --line...) nen tu dung ca o giao dien TOI lan SANG.
   C7 (luat L21): o dien thoai 390px moi thu phai vua trong man hinh - khong mot o nao o day co be rong
   co dinh lon hon 320px, va canvas thi lay be rong THAT cua khung cha (getBoundingClientRect). */

.quay-box { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.quay-page .page-head p { max-width: 72ch; }

/* ---------- vong quay ---------- */
.quay-vong { width: 100%; max-width: 340px; margin: 4px auto 10px; }
.quay-vong canvas { display: block; width: 100%; height: auto; }
/* Dang quay: khong cho bam / keo vao mat vong. */
.quay-vong.dang-quay { cursor: progress; }
.quay-vong canvas { -webkit-user-select: none; user-select: none; touch-action: manipulation; }

/* ---------- nut quay ---------- */
.quay-nut { max-width: 340px; margin-top: 4px; font-weight: 800; letter-spacing: .01em; }
.quay-ghi { max-width: 46ch; margin: 8px 0 0; text-align: center; line-height: 1.5; }

/* ---------- o ket qua cua chinh minh ---------- */
.quay-kq {
  width: 100%; max-width: 420px; margin: 6px auto 0; padding: 14px 16px; border-radius: 14px; text-align: center;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .18) 0, transparent 55%),
    linear-gradient(135deg, #1f845a 0%, #216e4e 55%, #0c66e4 100%);
  color: #fff; animation: quay-hien .4s cubic-bezier(.2, .8, .2, 1);
}
.quay-kq-nhan { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.quay-kq-ten { margin: 4px 0 6px; font-size: 26px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.quay-kq .muted { color: rgba(255, 255, 255, .88) !important; }

/* v61: BA ngach cua minh, danh so 1-2-3. Mot ten ngach dai («Gia dụng – home và Living») phai xuong dong
   duoc chu khong duoc tran ra khoi o mau xanh - do la ly do dung `overflow-wrap: anywhere` nhu `.quay-kq-ten`.
   Co chu nho hon ban mot-ngach cua v43 (26px) vi gio co ba dong chu khong phai mot. */
.quay-kq-ds { list-style: none; margin: 8px 0 8px; padding: 0; display: grid; gap: 7px; text-align: left; }
.quay-kq-ds li {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: baseline; gap: 8px;
  padding: 7px 10px; border-radius: 9px; background: rgba(255, 255, 255, .14);
}
.quay-kq-ds b { font-size: 16px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.quay-kq-so {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); font-size: 11.5px; font-weight: 800;
}
.quay-kq-ds .muted { font-size: 11px; white-space: nowrap; }
/* v61: chua du 3 ngach vi vong het cho. Nen o ket qua la dai xanh-xanh duong, nen dong nay phai NOI BAT
   len tren do ma van doc duoc - dung nen trang mo + vien, khong doi mau chu (chu trang tren nen do la
   cap tuong phan kem). */
.quay-kq-thieu {
  margin-top: 4px; padding: 8px 10px; border-radius: 9px; font-size: 12.5px; line-height: 1.45;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .28); text-align: left;
}

@keyframes quay-hien { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .quay-kq { animation: none; } }

.quay-trong { padding: 18px 4px; text-align: center; color: var(--ink-soft); }

/* ---------- bang ket qua ---------- */
.quay-bang-tieu { margin: 2px 0 10px; font-size: 15px; }
.quay-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
/* v61: cot «Ngách» chua BA ngach moi dong. Xep doc (khong phai mot hang ngang dai) de o dien thoai 390px
   bang khong bi keo ngang - ten ngach cua cong ty dai den 25 ky tu, ba cai nam ngang la tran chac chan.
   `anywhere` de mot ten dai tu xuong dong trong the cua no thay vi day rong ca cot. */
.quay-ngach-ds { display: flex; flex-direction: column; gap: 5px; }
.quay-ngach-the {
  display: inline-flex; align-items: baseline; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere;
}
.quay-ngach-the .quay-dot { flex: none; align-self: center; }
.quay-table tr.quay-toi > td { background: var(--accent-soft); }
.quay-table tr.quay-chua-dong > td { opacity: .78; }
.quay-table td { vertical-align: middle; }

/* Dien thoai: cot «Lúc» xuong dong duoc, bang khong bi keo ngang vi mot o ngay thang. */
@media (max-width: 520px) {
  .quay-kq-ten { font-size: 22px; }
  .quay-table th:last-child, .quay-table td:last-child { min-width: 0; white-space: normal; }
}
