/* Word Galaxy (Mr. Inkwell) */
.wg-les { max-width: 620px; margin: 0 auto; padding: 12px 16px 36px; }
.wg-les-inline { padding: 12px; margin-top: 10px; border: 2px solid color-mix(in srgb, #6366f1 35%, transparent); border-radius: var(--radius-lg); background: var(--color-surface); }
.wg-bar { display: flex; align-items: center; gap: 8px; }
.wg-bar-title { flex: 1; font-weight: 800; text-align: center; font-size: var(--text-sm); }
.wg-x { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--color-text-muted); }
.wg-dots { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 8px 0 10px; }
.wg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-border); }
.wg-dot-done { background: #6366f1; }
.wg-dot-now { background: #6366f1; box-shadow: 0 0 0 3px color-mix(in srgb, #6366f1 30%, transparent); }
.wg-dot-end { width: auto; height: auto; background: none; font-size: 12px; box-shadow: none; }
.wg-art { display: block; width: 100%; max-width: 480px; margin: 0 auto 10px; border-radius: var(--radius-lg); image-rendering: pixelated; aspect-ratio: 16 / 9; object-fit: cover; }
.wg-head { display: flex; align-items: center; gap: 10px; }
.wg-ink { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; flex: none; }
.wg-ink-big { width: 96px; height: 96px; }
.wg-title { font-weight: 800; font-size: 1.1rem; }
.wg-say { margin-top: 8px; font-size: var(--text-sm); line-height: 1.7; }
.wg-fill-track { height: 4px; border-radius: 4px; background: var(--color-border); margin: 10px 0; overflow: hidden; }
.wg-fill { height: 100%; width: 0; background: #6366f1; }

.wg-visual { min-height: 40px; padding: 12px; border-radius: var(--radius-lg); background: var(--color-surface-2); }
.wg-line, .wg-row { min-height: 1.4em; line-height: 1.6; }
.wg-line.wg-in, .wg-row.wg-in, .wg-cap { animation: wgIn .45s ease both; }
@keyframes wgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wg-cap { font-size: var(--text-sm); color: var(--color-text-muted); margin: 4px 0; }
.wg-row + .wg-row { margin-top: 8px; }

.wg-chip { display: inline-flex; flex-direction: column; align-items: center; margin: 0 2px 4px; vertical-align: top; }
.wg-chip-w { padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.wg-chip-l { font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--color-text-muted); margin-top: 1px; }
.wg-plain { white-space: pre-wrap; }
.wg-r-noun .wg-chip-w, .wg-r-subj .wg-chip-w { background: color-mix(in srgb, #3b82f6 22%, transparent); }
.wg-r-verb .wg-chip-w { background: color-mix(in srgb, #ef4444 20%, transparent); }
.wg-r-adj .wg-chip-w { background: color-mix(in srgb, #22c55e 24%, transparent); }
.wg-r-adv .wg-chip-w { background: color-mix(in srgb, #a855f7 22%, transparent); }
.wg-r-pron .wg-chip-w, .wg-r-obj .wg-chip-w { background: color-mix(in srgb, #14b8a6 22%, transparent); }
.wg-r-conj .wg-chip-w, .wg-r-key .wg-chip-w { background: color-mix(in srgb, #f97316 24%, transparent); }
.wg-r-prep .wg-chip-w, .wg-r-art .wg-chip-w { background: color-mix(in srgb, #eab308 24%, transparent); }
.wg-r-main .wg-chip-w { background: color-mix(in srgb, #3b82f6 16%, transparent); border-bottom: 3px solid #3b82f6; border-radius: 6px 6px 0 0; }
.wg-r-sub .wg-chip-w { background: color-mix(in srgb, #f97316 16%, transparent); border-bottom: 3px solid #f97316; border-radius: 6px 6px 0 0; }
.wg-r-new .wg-chip-w { background: color-mix(in srgb, #22c55e 30%, transparent); }
.wg-r-right .wg-chip-w { background: color-mix(in srgb, #22c55e 26%, transparent); }
.wg-r-wrong .wg-chip-w { background: color-mix(in srgb, #ef4444 16%, transparent); text-decoration: line-through; }

.wg-split { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wg-part { padding: 4px 10px; border-radius: 8px; font-weight: 800; animation: wgSnap .6s ease both; }
.wg-part-0 { background: color-mix(in srgb, #a855f7 24%, transparent); }
.wg-part-1 { background: color-mix(in srgb, #3b82f6 24%, transparent); }
.wg-part-2 { background: color-mix(in srgb, #22c55e 26%, transparent); }
@keyframes wgSnap { from { transform: translateX(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.wg-plus, .wg-eq { font-weight: 800; color: var(--color-text-muted); }
.wg-word { font-weight: 800; font-size: 1.1rem; padding: 4px 10px; border-radius: 8px; border: 2px solid #6366f1; animation: wgIn .6s .3s ease both; }
.wg-note { flex-basis: 100%; font-size: var(--text-xs); color: var(--color-text-muted); }

.wg-swap { line-height: 2; }
.wg-sw { display: inline-block; padding: 0 3px; border-radius: 5px; }
.wg-sw-from .wg-sw { color: var(--color-text-muted); }
.wg-sw-gone { text-decoration: line-through; color: #dc2626 !important; }
.wg-sw-moved { background: color-mix(in srgb, #6366f1 22%, transparent); font-weight: 800; }
.wg-sw-new { background: color-mix(in srgb, #22c55e 28%, transparent); font-weight: 800; }
.wg-sw-arrow { color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.2; }
.wg-sw-to { font-weight: 600; }

.wg-clue-line { font-size: 1.02rem; }
.wg-target { padding: 1px 6px; border: 2px dashed #6366f1; border-radius: 6px; font-weight: 800; }
.wg-clue { background: linear-gradient(transparent 55%, color-mix(in srgb, #facc15 60%, transparent) 55%); animation: wgGlow 1.4s .4s ease both; }
@keyframes wgGlow { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
.wg-clue { background-repeat: no-repeat; }

.wg-tip { margin-top: 10px; font-size: var(--text-sm); color: var(--color-text-muted); }
.wg-check { margin-top: 14px; }
.wg-q { font-weight: 700; margin-bottom: 8px; }
.wg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wg-opt { padding: 10px; border-radius: var(--radius-md); border: 2px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; cursor: pointer; text-align: center; }
.wg-right { border-color: #22c55e; background: color-mix(in srgb, #22c55e 14%, transparent); font-weight: 800; }
.wg-wrong { border-color: #ef4444; background: color-mix(in srgb, #ef4444 10%, transparent); }
.wg-dim { opacity: .55; }
.wg-fb { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.55; }
.wg-fb-ok { background: color-mix(in srgb, #22c55e 14%, transparent); }
.wg-fb-no { background: color-mix(in srgb, #f59e0b 16%, transparent); }
.wg-next { width: 100%; margin-top: 12px; }
.wg-done { text-align: center; padding: 10px 0; }
.wg-done-note { font-size: var(--text-sm); color: var(--color-text-muted); }

.wg-shelf { margin: 16px 0; padding: 14px; border-radius: var(--radius-lg); background: var(--color-surface); border: 2px solid color-mix(in srgb, #6366f1 30%, transparent); }
.wg-shelf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wg-shelf-title { margin: 0; font-weight: 800; font-size: 1.1rem; }
/* one shelf at a time: a scrolling row of tabs, the kid's grade marked with a dot */
.wg-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; margin: 4px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wg-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .wg-tabs { flex-wrap: wrap; overflow: visible; } }
.wg-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font: inherit; font-size: var(--text-sm); font-weight: 700;
  border: 1.5px solid var(--color-border); background: var(--color-surface-2); color: var(--color-text); cursor: pointer; white-space: nowrap; }
.wg-tab.yours::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6366f1; }
.wg-tab.on { background: #6366f1; border-color: #6366f1; color: #fff; }
.wg-tab.on.yours::before { background: #fff; }
.wg-tab.on .wg-grade-count { color: rgba(255,255,255,0.85); }
.wg-tab:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.wg-shelf-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.wg-grade { border-top: 1px solid var(--color-border); padding: 8px 0; }
.wg-grade summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; }
.wg-grade-count { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 700; }
.wg-yours { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, #6366f1 18%, transparent); }
.wg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin-top: 8px; }
.wg-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface-2); color: var(--color-text); cursor: pointer; text-align: left; font: inherit; }
.wg-card-done { border-color: color-mix(in srgb, #22c55e 50%, transparent); }
.wg-card-icon { font-size: 1.4rem; }
.wg-card-t { font-weight: 700; font-size: var(--text-sm); line-height: 1.3; }
.wg-card-tag { font-size: 10px; font-weight: 800; color: #6366f1; }
.wg-card-done .wg-card-tag { color: #16a34a; }
.wg-watch { margin-top: 10px; }
.wg-watch-btn { padding: 8px 12px; border-radius: 999px; border: 2px solid #6366f1; background: color-mix(in srgb, #6366f1 10%, transparent); color: var(--color-text); font-weight: 800; cursor: pointer; font-size: var(--text-sm); }
@media (prefers-reduced-motion: reduce) { .wg-in, .wg-part, .wg-word, .wg-clue, .wg-cap { animation: none; } }
/* Played from inside a daily hint: don't inherit the hint's orange italics */
.eng-hint-text .wg-watch, .eng-hint-text .wg-les-inline { font-style: normal; color: var(--color-text); text-align: left; }
.eng-hint-text .wg-watch-btn { font-style: normal; }

/* phon: letters inside words lit up, sound boxes, a word changing */
.wg-phon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 1.7rem; font-weight: 800; letter-spacing: .02em; }
.wg-ph-word { display: inline-flex; align-items: flex-end; gap: 0; }
.wg-ph-boxed { gap: 4px; }
.wg-ph-box { display: inline-block; min-width: 1.2em; padding: 2px 6px; text-align: center; border: 2px solid var(--color-border); border-radius: 8px; background: var(--color-surface); }
.wg-ph-mark { border-radius: 5px; padding: 0 1px; }
.wg-ph-m0 { color: #2563eb; background: color-mix(in srgb, #2563eb 14%, transparent); }
.wg-ph-m1 { color: #db2777; background: color-mix(in srgb, #db2777 14%, transparent); }
.wg-ph-m2 { color: #059669; background: color-mix(in srgb, #059669 14%, transparent); }
.wg-ph-silent { opacity: .45; text-decoration: underline dotted; text-underline-offset: 4px; }
.wg-ph-arrow { color: var(--color-text-muted); font-weight: 600; }
[data-theme="dark"] .wg-ph-m0 { color: #93c5fd; }
[data-theme="dark"] .wg-ph-m1 { color: #f9a8d4; }
[data-theme="dark"] .wg-ph-m2 { color: #6ee7b7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .wg-ph-m0 { color: #93c5fd; }
  :root:not([data-theme]) .wg-ph-m1 { color: #f9a8d4; }
  :root:not([data-theme]) .wg-ph-m2 { color: #6ee7b7; }
}
@media (max-width: 520px) { .wg-phon { font-size: 1.35rem; gap: 8px 12px; } }

/* Phones: on Word Adventure's home the shelf is one swipeable row, so a
   ten-lesson shelf is a card tall instead of five. */
@media (max-width: 699px) {
  .eng-home .wg-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 40%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .eng-home .wg-cards::-webkit-scrollbar { display: none; }
  .eng-home .wg-card { scroll-snap-align: start; }
}
