/* Nói Cùng Cô — giao diện cho trẻ tiểu học: nút to, chữ rõ, màu ấm, ít chữ. */
:root {
  --nen: #fff7ec;
  --the: #ffffff;
  --chu: #2b2340;
  --chu-phu: #6d6585;
  --vien: #f0e2cf;
  --tim: #6c4cf5;
  --tim-nhat: #ece7ff;
  --xanh: #1fae6b;
  --xanh-nhat: #e3f7ec;
  --vang: #f2a20c;
  --vang-nhat: #fff2d6;
  --do: #e5484d;
  --do-nhat: #ffe7e6;
  --xanh-duong: #2f80ed;
  --bong: 0 6px 0 rgba(43, 35, 64, .08);
  --bo: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--nen); color: var(--chu);
  font: 600 17px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1 { font-size: 24px; font-weight: 900; margin: 6px 0 6px; line-height: 1.2; }
h2 { font-size: 21px; font-weight: 900; margin: 0 0 6px; }
.phu { color: var(--chu-phu); margin: 0 0 14px; font-weight: 600; }
.nho { font-size: 14px; color: var(--chu-phu); font-weight: 700; }

.dau {
  position: sticky; top: 0; z-index: 5; background: var(--nen);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 2px solid var(--vien);
}
.co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mat { width: 52px; height: 52px; flex: none; border-radius: 50%; background: #fff; box-shadow: var(--bong); display: grid; place-items: center; }
.mat svg { width: 46px; height: 46px; }
.ten-app { font-weight: 900; font-size: 19px; color: var(--tim); }
.loi-co { font-size: 14.5px; color: var(--chu-phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { max-width: 560px; margin: 0 auto; padding: 14px 16px; }

.nut {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; padding: 10px 18px; border-radius: 999px;
  background: #fff; color: var(--chu); font: inherit; font-weight: 800; font-size: 17px;
  box-shadow: var(--bong), inset 0 0 0 2px var(--vien);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.nut:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(43,35,64,.08), inset 0 0 0 2px var(--vien); }
.nut:disabled { opacity: .45; cursor: not-allowed; }
.nut.chinh { background: var(--tim); color: #fff; box-shadow: 0 6px 0 #4a2fd0; }
.nut.nghe { background: var(--xanh-duong); color: #fff; box-shadow: 0 6px 0 #1f5fb8; }
.nut.cham { background: var(--vang-nhat); box-shadow: var(--bong), inset 0 0 0 2px #f6d58f; }
.nut.do { background: var(--do); color: #fff; box-shadow: 0 6px 0 #b8292e; }
.nut.phu-nut { min-height: 46px; font-size: 15.5px; }
.nut.rong { width: 100%; margin-top: 12px; }
.nut-tron { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--bong); font-size: 22px; cursor: pointer; }
.hang-nut { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.mic {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 150px; height: 150px; margin: 18px auto 10px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #8f76ff, var(--tim)); color: #fff;
  box-shadow: 0 10px 0 #4a2fd0, 0 0 0 10px var(--tim-nhat);
  font: inherit; font-weight: 900; transition: transform .15s ease-out;
}
.mic .icon { font-size: 50px; line-height: 1; }
.mic .nhan { font-size: 16px; }
.mic:active { transform: translateY(4px); }
.mic.dang-nghe { background: radial-gradient(circle at 35% 30%, #ff7a7e, var(--do)); box-shadow: 0 10px 0 #b8292e, 0 0 0 10px var(--do-nhat); animation: nhip 1.1s ease-in-out infinite; }
.mic:disabled { opacity: .5; }
@keyframes nhip { 50% { box-shadow: 0 10px 0 #b8292e, 0 0 0 20px var(--do-nhat); } }
@media (prefers-reduced-motion: reduce) { .mic.dang-nghe { animation: none; } }
.dem { text-align: center; font-weight: 900; color: var(--do); }

textarea {
  width: 100%; border: 2px solid var(--vien); border-radius: 18px; padding: 12px 14px;
  font: inherit; font-weight: 700; color: var(--chu); background: #fff; resize: vertical;
}
textarea:focus { outline: 3px solid var(--tim-nhat); border-color: var(--tim); }
.o-nhap { display: grid; gap: 10px; margin-top: 6px; }

.the-ket-qua, .the-cau, .the {
  background: var(--the); border-radius: var(--bo); padding: 16px; margin-top: 16px;
  box-shadow: var(--bong), inset 0 0 0 2px var(--vien);
}
.cau-anh { font-size: 26px; font-weight: 900; line-height: 1.3; color: var(--tim); word-break: break-word; }
.nguon { margin-top: 10px; font-size: 13px; color: var(--chu-phu); }

.chu-de { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chu-de button {
  flex: none; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; font-size: 15px;
  background: #fff; box-shadow: inset 0 0 0 2px var(--vien); cursor: pointer; color: var(--chu);
}
.chu-de button.dang { background: var(--tim); color: #fff; box-shadow: none; }

/* Kết quả chấm */
.sao { font-size: 34px; letter-spacing: 2px; text-align: center; margin: 4px 0; }
.khen { text-align: center; font-weight: 900; font-size: 20px; }
.diem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 8px; }
.diem div { background: var(--nen); border-radius: 14px; padding: 8px 4px; text-align: center; }
.diem b { display: block; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.diem span { font-size: 12px; color: var(--chu-phu); font-weight: 800; }
.cac-tu { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tu {
  border: 0; border-radius: 12px; padding: 6px 12px; font: inherit; font-weight: 900; font-size: 20px; cursor: pointer;
}
.tu.tot { background: var(--xanh-nhat); color: #13784a; }
.tu.vua { background: var(--vang-nhat); color: #9a6200; }
.tu.yeu { background: var(--do-nhat); color: #b42318; }
.tu.thieu { background: #f2f0f5; color: #9a94aa; text-decoration: line-through; }
.chu-thich { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--chu-phu); font-weight: 700; }
.chu-thich i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 4px; }
.loi-khuyen { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.loi-khuyen li { background: var(--nen); border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.loi-khuyen li button { margin-left: 6px; border: 0; background: var(--xanh-duong); color: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.moc { font-variant-numeric: tabular-nums; color: var(--tim); font-weight: 900; }
.so-bo { background: var(--vang-nhat); border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; color: #7a4f00; margin-top: 10px; }

.khung-video { position: relative; margin-top: 12px; border-radius: var(--bo); overflow: hidden; background: #241d36; aspect-ratio: 3 / 4; box-shadow: var(--bong); }
.khung-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #241d36; }
.guong { transform: scaleX(-1); }
.dong-ho { position: absolute; top: 12px; right: 12px; background: var(--do); color: #fff; font-weight: 900; padding: 4px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.chua-mo { position: absolute; inset: 0; display: grid; place-items: center; color: #d8d0f0; font-weight: 800; text-align: center; padding: 20px; }

.thanh-duoi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; border-top: 2px solid var(--vien);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab { border: 0; background: none; font: inherit; font-weight: 800; font-size: 13.5px; color: var(--chu-phu); display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 16px; cursor: pointer; }
.tab span { font-size: 24px; }
.tab.dang { color: var(--tim); background: var(--tim-nhat); }

dialog { border: 0; border-radius: var(--bo); padding: 18px; width: min(92vw, 420px); color: var(--chu); background: #fff; }
dialog::backdrop { background: rgba(43, 35, 64, .45); }
.chon-giong { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--nen); margin-top: 8px; font-weight: 800; cursor: pointer; }
.chon-giong input { width: 20px; height: 20px; accent-color: var(--tim); }

.bao {
  position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 9;
  background: var(--chu); color: #fff; border-radius: 16px; padding: 12px 16px; font-weight: 800; text-align: center;
  max-width: 520px; margin: 0 auto;
}
