/* =============================================================================
   PICK WIZARD — giao diện thân thiện cho cả trẻ em (tiền tố .pw-)
   Nút to >= 44px (thẻ chọn >= 60px), chữ >= 15px, màu dịu, không in ra giấy.
   ============================================================================= */
html.pw-open,
html.pw-open body { overflow: hidden; }

.pw-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    font-family: inherit;
}

.pw-backdrop[hidden] { display: none; }

.pw-card {
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fffdf7;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: pw-pop 0.22s ease-out;
}

@keyframes pw-pop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pw-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 0;
}

.pw-back,
.pw-close {
    border: none;
    background: #f1f5f9;
    color: #334155;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;
    min-height: 44px;
    padding: 0 16px;
    cursor: pointer;
}

.pw-close { width: 44px; padding: 0; font-size: 18px; }

.pw-dots { display: flex; gap: 8px; }
.pw-dots span { width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; }
.pw-dots span.is-done { background: #34d399; }
.pw-dots span.is-now { background: #f97316; transform: scale(1.25); }

.pw-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 10px;
}

.pw-mascot { flex: 0 0 auto; font-size: 46px; line-height: 1; }
.pw-head > div { flex: 1 1 auto; min-width: 0; }

.pw-ask {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.pw-hint { margin: 4px 0 0; font-size: 16px; color: #475569; line-height: 1.45; }

.pw-speak {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid #bfdbfe;
    background: #eff6ff;
    font-size: 22px;
    cursor: pointer;
}

.pw-body { padding: 8px 22px 24px; overflow-y: auto; }

.pw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.pw-list { display: flex; flex-direction: column; gap: 8px; }

.pw-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 96px;
    padding: 14px 12px;
    border: 2.5px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.pw-list .pw-opt {
    flex-direction: row;
    justify-content: flex-start;
    min-height: 60px;
    text-align: left;
    border-radius: 14px;
}

.pw-opt:hover { border-color: #93c5fd; background: #f8fbff; }
.pw-opt:active { transform: scale(0.97); }
.pw-opt.is-picked { border-color: #10b981; background: #ecfdf5; }

.pw-opt:focus-visible,
.pw-chip:focus-visible,
.pw-go:focus-visible,
.pw-back:focus-visible,
.pw-close:focus-visible,
.pw-speak:focus-visible { outline: 3px solid #f97316; outline-offset: 2px; }

.pw-icon { font-size: 34px; line-height: 1; }
.pw-big { font-size: 40px; font-weight: 900; line-height: 1; color: #2563eb; }
/* Câu chào thay cờ quốc gia (cờ hiện thành chữ "GB" trên Windows): "Hello", "你好"... */
.pw-greet { font-size: 26px; font-weight: 800; line-height: 1.2; color: #ea580c; }
.pw-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.pw-desc { font-size: 14px; color: #64748b; line-height: 1.35; }

.pw-search {
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    margin-bottom: 12px;
    padding: 10px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    font: inherit;
    font-size: 17px;
}

.pw-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.pw-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.pw-chip span { color: #94a3b8; }

.pw-go {
    width: 100%;
    min-height: 64px;
    border: none;
    border-radius: 18px;
    background: #10b981;
    color: #fff;
    font: inherit;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.pw-go:disabled { opacity: 0.75; cursor: wait; }
.pw-note { margin: 12px 0 0; text-align: center; font-size: 15px; color: #64748b; }

/* Nút mở lại bảng hướng dẫn trên thanh trên cùng */
.pw-launch { background: #f97316 !important; color: #fff !important; }

/* Điện thoại: bảng chiếm trọn màn hình, câu hỏi nhỏ lại cho vừa */
@media (max-width: 600px) {
    .pw-backdrop { padding: 0; align-items: flex-end; }
    .pw-card { max-height: 100vh; height: 100%; border-radius: 0; }
    .pw-head { padding: 10px 16px 8px; gap: 10px; }
    .pw-mascot { font-size: 36px; }
    .pw-ask { font-size: 22px; }
    .pw-body { padding: 6px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
    .pw-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .pw-card,
    .pw-opt { animation: none; transition: none; }
}

@media print {
    .pw-backdrop { display: none !important; }
}
