/* ---------- Word games batch (gw) ---------- */
.gw-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; margin-bottom: 4px; }
.gw-opts .g-seg { margin-bottom: 8px; }
.gw-hard { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 8px; cursor: pointer; min-height: 40px; }
.gw-hard input { width: 18px; height: 18px; accent-color: var(--c); }
.gw-board { display: grid; gap: 6px; justify-content: center; margin: 4px auto 6px; }
.gw-row { display: grid; grid-template-columns: repeat(var(--n, 5), min(calc((100vw - 90px) / var(--n, 5)), 60px)); gap: 6px; }
.gw-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 800; font-size: clamp(1.1rem, 5.4vw, 1.7rem); color: var(--ink); text-transform: uppercase; line-height: 1; }
.gw-cell.gw-filled { border-color: var(--muted); animation: gw-pop .12s ease; }
.gw-cell i { position: absolute; right: 3px; top: 1px; font-style: normal; font-size: .62rem; font-weight: 700; opacity: .9; }
.gw-ok { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; }
.gw-in { background: #ca8a04 !important; border-color: #ca8a04 !important; color: #fff !important; }
.gw-fam { background: #bae6fd !important; border-color: #38bdf8 !important; color: #0c4a6e !important; }
.gw-no { background: #64748b !important; border-color: #64748b !important; color: #fff !important; }
.gw-row.gw-flip .gw-cell { animation: gw-flip .45s ease both; }
.gw-row.gw-flip .gw-cell:nth-child(2) { animation-delay: .08s; } .gw-row.gw-flip .gw-cell:nth-child(3) { animation-delay: .16s; } .gw-row.gw-flip .gw-cell:nth-child(4) { animation-delay: .24s; } .gw-row.gw-flip .gw-cell:nth-child(5) { animation-delay: .32s; }
.gw-shake { animation: gw-shake .35s ease; }
@keyframes gw-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes gw-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes gw-pop { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .gw-row.gw-flip .gw-cell, .gw-shake, .gw-cell.gw-filled { animation: none; } }
.gw-msg { min-height: 1.4em; text-align: center; font-weight: 600; color: var(--c); font-size: .92rem; margin: 2px 0 6px; }
.gw-kb { display: grid; gap: 6px; margin: 4px auto 0; max-width: 520px; }
.gw-kr { display: flex; gap: 5px; justify-content: center; }
.gw-k { flex: 1 1 0; max-width: 46px; min-width: 0; height: 50px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; padding: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); touch-action: manipulation; }
.gw-kb-ta .gw-k { max-width: 54px; font-size: 1.12rem; height: 46px; }
.gw-k.gw-kw { max-width: 66px; flex-grow: 1.5; font-size: 1.25rem; background: color-mix(in srgb, var(--c) 18%, var(--surface-2)); }
.gw-k.gw-ks { background: color-mix(in srgb, var(--c) 9%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--c) 45%, transparent); }
.gw-k:hover { filter: brightness(.96); }
.gw-k:focus-visible, .gw-kopt:focus-visible, .gw-lm button:focus-visible, .gw-xw-c:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.gw-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: .78rem; color: var(--muted); margin: 12px 0 0; }
.gw-c { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: .7rem; font-weight: 800; margin-right: 4px; vertical-align: -4px; }
.gw-ans { display: block; margin-bottom: 6px; } .gw-ans b { color: var(--c); font-size: 1.15em; }
.gw-grid { display: block; margin-top: 8px; line-height: 1.25; letter-spacing: 2px; }

/* ---------- Kural quiz ---------- */
.gw-kural { position: relative; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, var(--surface)), var(--surface-2)); border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 14px; padding: 16px 16px 14px; margin: 4px 0 12px; }
.gw-kural p { margin: 6px 0 0; font-size: clamp(1.02rem, 4.2vw, 1.22rem); font-weight: 600; line-height: 1.75; color: var(--ink); }
.gw-kno { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .04em; }
.gw-kblank { display: inline-block; min-width: 4.5em; border-bottom: 3px dotted var(--c); color: transparent; }
.gw-kfill { background: color-mix(in srgb, #16a34a 18%, transparent); color: inherit; border-radius: 5px; padding: 0 3px; }
.gw-kp { font-weight: 700; margin: 0 0 10px; }
.gw-kopts { display: grid; gap: 8px; }
.gw-kopt { position: relative; display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 36px 11px 12px; cursor: pointer; min-height: 48px; line-height: 1.4; }
.gw-kopt b { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); font-size: .82rem; }
.gw-kopt:hover:not(:disabled) { border-color: var(--c); }
.gw-kopt:disabled { cursor: default; }
.gw-kopt.is-ok { border-color: #16a34a; background: color-mix(in srgb, #16a34a 12%, var(--surface)); }
.gw-kopt.is-bad { border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, var(--surface)); }
.gw-kopt i { position: absolute; right: 12px; top: 11px; font-style: normal; font-weight: 800; }
.gw-kopt.is-ok i { color: #16a34a; } .gw-kopt.is-bad i { color: #dc2626; }
.gw-kexp { margin: 12px 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .93rem; line-height: 1.55; }
.gw-kexp.ok b:first-child { color: #16a34a; } .gw-kexp.bad b:first-child { color: #dc2626; }
.gw-kmean { display: block; margin-top: 4px; color: var(--ink-2, var(--ink)); }
.gw-kfb .btn { width: 100%; justify-content: center; }

/* ---------- Letter match ---------- */
.gw-lm-hint { text-align: center; color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.gw-lm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 440px; margin: 0 auto; }
.gw-lm-col { display: grid; gap: 10px; }
.gw-lm button { position: relative; font: inherit; min-height: 64px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 6px; transition: transform .12s, border-color .12s; }
.gw-lm .gw-lm-l { font-size: 2.1rem; font-weight: 800; color: var(--c) !important; }
.gw-lm .gw-lm-r { font-size: 1.3rem; font-weight: 700; }
.gw-lm-r.gw-pic { gap: 2px; } .gw-emo { font-size: 2rem; line-height: 1; } .gw-lm-r small { font-size: .8rem; color: var(--muted); min-height: 1em; }
.gw-lm button.sel { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); transform: scale(1.03); }
.gw-lm button.ok { border-color: #16a34a; background: color-mix(in srgb, #16a34a 12%, var(--surface)); cursor: default; }
.gw-lm button.bad { border-color: #dc2626; animation: gw-shake .35s ease; }
.gw-tick { position: absolute; top: 4px; right: 8px; font-style: normal; color: #16a34a; font-size: .9rem; }
.gw-lm-prog { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.gw-lm-prog span { width: 28px; height: 6px; border-radius: 3px; background: var(--border); } .gw-lm-prog .done { background: #16a34a; } .gw-lm-prog .now { background: var(--c); }

/* ---------- Word search ---------- */
.gw-ws-top { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; margin-bottom: 8px; }
.gw-ws-top .g-seg { margin-bottom: 0; }
.gw-ws-theme { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.gw-ws-theme select { font: inherit; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); min-height: 40px; max-width: 220px; }
.gw-ws-main { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: start; }
.gw-ws-grid { display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 2px; background: var(--border); border: 2px solid var(--border); border-radius: 12px; overflow: hidden; touch-action: none; max-width: 600px; width: 100%; margin: 0 auto; }
.gw-ws-c { aspect-ratio: 1; display: grid; place-items: center; background: var(--surface); font-weight: 700; font-size: clamp(.8rem, 3.6vw, 1.25rem); cursor: pointer; color: var(--ink); user-select: none; line-height: 1; }
.gw-ws-grid.gw-ta .gw-ws-c { font-size: clamp(.7rem, 3.2vw, 1.1rem); font-weight: 600; }
.gw-ws-c.sel { background: color-mix(in srgb, var(--c) 35%, var(--surface)); }
.gw-ws-c.found { color: #111; }
.gw-ws-c.f0 { background: #fde68a; } .gw-ws-c.f1 { background: #bbf7d0; } .gw-ws-c.f2 { background: #bfdbfe; } .gw-ws-c.f3 { background: #fbcfe8; } .gw-ws-c.f4 { background: #ddd6fe; } .gw-ws-c.f5 { background: #fed7aa; }
.gw-ws-c.found.sel { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.gw-ws-h { font-size: 1rem; margin: 2px 0 8px; }
.gw-ws-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gw-ws-list li { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: .88rem; }
.gw-ws-list li.done { text-decoration: line-through; color: var(--muted); background: color-mix(in srgb, #16a34a 14%, var(--surface)); }
.gw-ws-list li i { font-style: normal; color: #16a34a; margin-right: 4px; }
.gw-ws-tip { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
@media (max-width: 720px) { .gw-ws-main { grid-template-columns: 1fr; } }

/* ---------- Mini crossword ---------- */
.gw-xw-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.gw-xw-nav .g-btn { min-width: 44px; min-height: 40px; font-size: 1.3rem; padding: 2px 10px; }
.gw-xw-name { font-weight: 700; min-width: 90px; text-align: center; }
.gw-xw-note { text-align: center; font-size: .85rem; color: var(--muted); margin: 0 0 8px; }
.gw-xw-main { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; justify-content: center; }
.gw-xw-clue { min-height: 3em; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, var(--surface-2)); font-size: .92rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gw-xw-clue b { color: var(--c); }
.gw-xw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; background: #1e293b; padding: 3px; border-radius: 10px; width: min(100%, 340px); margin: 0 auto; }
.gw-xw-c { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 4px; background: #fff; color: #0f172a; font: inherit; font-weight: 800; font-size: clamp(1.2rem, 6vw, 1.8rem); cursor: pointer; display: grid; place-items: center; }
.gw-xw-c.blk { background: #1e293b; cursor: default; }
.gw-xw-c small { position: absolute; left: 4px; top: 2px; font-size: .62rem; font-weight: 700; color: #475569; }
.gw-xw-c.hl { background: #dbeafe; } .gw-xw-c.cur { background: #fde047; }
.gw-xw-c.bad span { color: #dc2626; text-decoration: line-through; }
.gw-xw-acts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.gw-xw-acts .g-btn { padding: 8px 12px; font-size: .88rem; min-height: 40px; }
.gw-xw-kb { margin-top: 6px; }
.gw-xw-lists { display: grid; gap: 12px; align-content: start; }
.gw-xw-lists h3 { font-size: .95rem; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.gw-xw-lists ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gw-xw-lists li { display: flex; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: .92rem; line-height: 1.4; }
.gw-xw-lists li b { min-width: 1.4em; color: var(--c); }
.gw-xw-lists li.on { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.gw-xw-lists li.done span { color: var(--muted); }
@media (max-width: 720px) { .gw-xw-main { grid-template-columns: 1fr; } }
html.dark .gw-fam { background: #7dd3fc !important; color: #082f49 !important; }
html.dark .gw-xw-c.hl { background: #bfdbfe; }
