:root { --ink:#1d3557; }
.practice-page { width: min(100%, 820px); margin: 0 auto; }
.practice-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.practice-toolbar .toolbar-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.icon-button { min-width:42px; min-height:40px; border:0; border-radius:14px; background:rgba(255,255,255,.76); font-size:1.15rem; cursor:pointer; }
.practice-shell { padding:26px; border:3px solid rgba(255,255,255,.82); border-radius:28px; background:#fff9; box-shadow:0 9px 0 rgba(68,95,132,.2); }
.practice-hero { text-align:center; }
.practice-hero .big-icon { font-size:4rem; }
.mode-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:24px; }
.mode-button { display:flex; flex-direction:column; gap:8px; align-items:flex-start; min-height:150px; padding:20px; border:3px solid #fff; border-radius:22px; color:var(--ink); background:#fff; box-shadow:0 5px 0 #c6d7e8; text-align:left; cursor:pointer; }
.mode-button:hover,.mode-button:focus-visible { transform:translateY(-2px); }
.mode-button .mode-icon { font-size:2rem; }
.mode-button strong { font-size:1.17rem; }
.mode-button small { color:#526c91; line-height:1.5; }
.question-head { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#526c91; font-weight:800; }
.progress-track { height:12px; margin:14px 0 22px; overflow:hidden; border-radius:999px; background:#dce9f5; }
.progress-fill { height:100%; border-radius:inherit; background:#49b686; transition:width .2s ease; }
.question-title { display:flex; align-items:center; justify-content:center; gap:12px; min-height:68px; margin:0 0 16px; text-align:center; font-size:clamp(1.35rem,5vw,2rem); }
.speak-button { flex:0 0 auto; min-width:48px; min-height:48px; border:0; border-radius:50%; background:#fff0a8; font-size:1.35rem; cursor:pointer; box-shadow:0 4px 0 #dfc85f; }
.stimulus-panel { display:flex; flex-direction:column; align-items:center; gap:12px; margin:16px auto 24px; padding:18px; border-radius:20px; background:#eef7ff; text-align:center; }
.stimulus-symbol { font-size:clamp(3rem,14vw,5.5rem); }
.listen-button,.hint-button { border:0; border-radius:999px; padding:12px 18px; color:var(--ink); background:#ffd95e; font:inherit; font-weight:800; cursor:pointer; }
.hint-button { background:#e8ddff; }
.answer-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.answer-button { min-height:96px; padding:14px; border:3px solid #d7e4ef; border-radius:20px; color:var(--ink); background:#fff; font:inherit; font-weight:800; font-size:1.05rem; cursor:pointer; }
.answer-button .answer-emoji { display:block; margin-bottom:5px; font-size:2.2rem; }
.answer-button.correct { border-color:#3ab47b; background:#d7f5e9; }
.answer-button.wrong { border-color:#e36464; background:#ffe0e0; }
.answer-button:disabled { opacity:1; cursor:default; }
.feedback-panel { min-height:74px; margin-top:18px; padding:14px; border-radius:18px; background:#fff; text-align:center; font-weight:800; }
.feedback-panel:empty { display:none; }
.next-button,.primary-action { border:0; border-radius:16px; padding:12px 20px; color:#fff; background:var(--ink); font:inherit; font-weight:800; cursor:pointer; }
.result-card { text-align:center; }
.result-card .result-icon { font-size:4.5rem; }
.result-card .result-score { font-size:1.25rem; font-weight:800; }
.result-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:18px; }
.secondary-action { border:2px solid #b8cbe0; border-radius:16px; padding:10px 17px; color:var(--ink); background:#fff; font:inherit; font-weight:800; cursor:pointer; }
.save-state { min-height:24px; color:#526c91; }
.x1-dialog { width:min(calc(100% - 28px),560px); border:0; border-radius:26px; padding:0; color:var(--ink); box-shadow:0 24px 80px #17304c55; }
.x1-dialog::backdrop { background:#17304c88; backdrop-filter:blur(3px); }
.x1-dialog form { position:relative; padding:26px; }
.x1-dialog h2 { margin:0 34px 10px 0; }
.x1-dialog p { color:#526c91; line-height:1.55; }
.dialog-close { position:absolute; top:14px; right:14px; width:38px; height:38px; border:0; border-radius:50%; background:#eaf1f8; font-size:1.4rem; cursor:pointer; }
.dialog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:20px; }
.voice-row { display:grid; grid-template-columns:130px 1fr; align-items:center; gap:12px; margin:14px 0; font-weight:800; }
.voice-row select,.child-form input { width:100%; min-height:44px; border:2px solid #c9d8e7; border-radius:13px; padding:8px 10px; color:var(--ink); background:#fff; font:inherit; }
.player-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:18px; }
.player-choice { display:flex; flex-direction:column; align-items:center; gap:7px; min-height:132px; padding:15px; border:3px solid #d9e6f1; border-radius:22px; color:var(--ink); background:#fff; font:inherit; cursor:pointer; }
.player-choice:hover,.player-choice:focus-visible { border-color:#6d87aa; }
.player-avatar { font-size:2.8rem; }
.player-choice small { color:#60789c; }
.anonymous-choice { background:#fff8d9; }
.player-actions { margin-top:18px; text-align:center; }
.avatar-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; margin:14px 0; }
.avatar-choice { aspect-ratio:1; border:3px solid transparent; border-radius:14px; background:#edf5fc; font-size:1.7rem; cursor:pointer; }
.avatar-choice[aria-pressed="true"] { border-color:#1d3557; background:#fff4b5; }
.child-form { margin-top:18px; padding-top:18px; border-top:2px solid #e1eaf3; }
.form-error { color:#a43c3c !important; }
.account-panel { display:flex; align-items:center; gap:10px; }
.account-button,.account-link { border:0; border-radius:14px; padding:9px 13px; color:var(--ink); background:rgba(255,255,255,.72); font:inherit; font-weight:800; cursor:pointer; }
.account-link { padding:6px 9px; font-size:.85rem; }
.account-name { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:800; }
.login-setup-note { color:#60789c; font-size:.92rem; }
@media (max-width:620px) {
  .mode-grid,.answer-grid { grid-template-columns:1fr; }
  .practice-shell { padding:20px 16px; }
  .practice-toolbar { align-items:flex-start; }
  .voice-row { grid-template-columns:1fr; gap:5px; }
  .avatar-grid { grid-template-columns:repeat(4,1fr); }
}

/* Keep account controls readable on narrow screens and all dialogs self-contained. */
.account-panel { min-width:0; }
.account-name { min-width:0; }
.account-button,.account-link { flex-shrink:0; white-space:nowrap; min-height:44px; }
.x1-dialog { max-height:calc(100dvh - 32px); overflow:auto; }
.x1-dialog .primary-action { background:#1d3557; color:#fff; min-height:48px; }
.x1-dialog .primary-action:disabled { opacity:.65; cursor:wait; }
.child-editor .child-form { margin-top:20px; padding-top:0; border:0; }
.child-form label { display:block; margin-bottom:8px; font-weight:700; }
.child-form input { box-sizing:border-box; font-size:16px; }
.child-editor .dialog-actions { position:sticky; bottom:-26px; background:white; padding:12px 0; }
.child-editor .dialog-actions button { flex:1; }
.player-choice strong { overflow-wrap:anywhere; }
@media(max-width:620px) {
  .site-toolbar { flex-wrap:wrap; }
  .site-toolbar > .account-panel { flex:1 0 100%; justify-content:space-between; }
  .site-toolbar > .language-switcher { width:100%; flex-wrap:nowrap; }
  .practice-toolbar { flex-wrap:wrap; }
  .practice-toolbar .toolbar-actions { width:100%; }
  .practice-toolbar .account-panel { flex:1 0 100%; justify-content:space-between; }
  .account-name { max-width:calc(100% - 90px); }
  .x1-dialog form { padding:22px 18px; }
  .child-editor .dialog-actions { bottom:-22px; }
  .avatar-grid { grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; }
  .avatar-choice { min-height:40px; padding:0; font-size:1.4rem; border-radius:10px; }
}

.children-list { display:grid; gap:12px; margin:20px 0; }
.child-row { display:flex; align-items:center; gap:12px; padding:12px; background:#f0f7ff; border-radius:18px; }
.child-row strong { flex:1; min-width:0; overflow-wrap:anywhere; }
.child-row button { flex-shrink:0; }
.account-panel .account-name { flex:1; }
.manage-children { font-size:.85rem; padding:8px 10px; }
.child-form .avatar-label { margin:16px 0 8px; font-size:.9rem; }
.child-form .avatar-grid { margin-top:8px; }
@media(max-width:620px) {
  .account-panel { gap:6px; }
  .account-panel .account-name { max-width:none; font-size:.85rem; }
  .lang-bar > .account-panel { min-width:0; }
}
.answer-button { font-size:clamp(1.4rem,2.7vw,2rem); line-height:1.5; min-height:112px; padding:22px; }
@media(min-width:768px) { .practice-page { width:min(100%,1040px); } .answer-grid { gap:22px; } .answer-button { min-height:145px; } }
.account-panel { flex-wrap:wrap; }
.account-panel a { text-decoration:none; display:inline-flex; align-items:center; }
.checkpoint-status { position:fixed; bottom:10px; right:10px; z-index:5; border-radius:12px; background:#fff; color:#1d3557; padding:8px 12px; font-size:14px; box-shadow:0 2px 10px #0002; }
