/* Games (word search, missing letters, listen) and the card swipe. Every game page is centred in the middle of the content area. */
.main>.session-wrap,.main>.game-wrap,.main>.endless-wrap{margin-left:auto;margin-right:auto}
.game-wrap{display:flex;flex-direction:column;min-height:calc(100vh - 190px);text-align:center}
.game-wrap .session-top{text-align:left}
.game-stage{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;width:100%;padding-bottom:28px}
.game-stage .quiz-options,.game-stage .feedback,.game-stage .session-actions{width:100%;max-width:460px}
.game-stage .feedback{margin-top:0;text-align:left}
.game-clue{margin:0;font-size:18px;font-weight:700;color:var(--navy)}
.game-wrap.result{align-items:center;justify-content:center}
.games-section{margin:34px 0 8px}
.games-head h2{margin:0 0 4px;font-size:20px}
.games-head p{margin:0 0 16px;color:var(--muted);font-size:13px}

.ws-grid{display:grid;grid-template-columns:repeat(var(--n),1fr);gap:5px;width:100%;max-width:420px;touch-action:manipulation}
.ws-cell{aspect-ratio:1;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--navy);font-weight:800;font-size:clamp(14px,4vw,19px);line-height:1;font-family:inherit;cursor:pointer;padding:0;transition:background .15s,border-color .15s,transform .15s}
.ws-cell:hover{border-color:var(--blue)}
.ws-cell.start{background:#e8f0ff;border-color:var(--blue);color:var(--blue-dark);transform:scale(1.06)}
.ws-cell.found{background:#eaf7f0;border-color:#9ed0b7;color:#278360}
.ws-cell.wrong{background:#fff0ee;border-color:#e7b9b2;color:#b56358}
.ws-words{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;list-style:none;margin:0;padding:0;max-width:460px}
.ws-words li{display:flex;flex-direction:column;align-items:center;gap:1px;padding:7px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:13px;color:var(--muted)}
.ws-words li.found{background:#eaf7f0;border-color:#9ed0b7;color:#278360}
.ws-words li.found span{font-size:12px}
.ws-cell.hint{background:#fff6dc;border-color:#e2b54a;color:#8a5a00}
.ws-words li.hint{background:#fff6dc;border-color:#e2b54a;color:#8a5a00}
.game-hint{display:flex;justify-content:center}

.hp-board{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;width:100%;max-width:560px}
.hp-column{display:flex;flex-direction:column;gap:9px;min-width:0}
.hp-column h2{margin:0 0 2px;font-size:13px;font-weight:800;color:var(--muted)}
.game-stage .hp-tries{margin:0}
.hp-tile{min-height:56px;padding:8px 10px;display:flex;align-items:center;justify-content:center;border:1px solid #cfdcf3;border-radius:14px;background:#f3f7ff;color:var(--navy);font:inherit;font-size:16px;font-weight:800;line-height:1.25;overflow-wrap:anywhere;cursor:pointer;transition:transform .12s ease,border-color .12s ease}
.hp-tile:hover{border-color:var(--blue)}
.hp-tile:active{transform:scale(.97)}
.hp-tile:focus-visible{outline:3px solid #2563eb55;outline-offset:2px}
.hp-tile:disabled{cursor:default;opacity:1}
.hp-mark{font-size:22px;color:#9db4dc}
.hp-tile.open{background:#e8f0ff;border-color:var(--blue);color:var(--blue-dark);animation:hp-reveal .18s ease}
.hp-tile.matched{background:#eaf7f0;border-color:#9ed0b7;color:#1d7a5a}
.hp-tile.miss{background:#fff0ee;border-color:#e7b9b2;color:#a23f33;animation:hp-reveal .18s ease}
@keyframes hp-reveal{from{opacity:.4;transform:scale(.96)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.hp-tile.open,.hp-tile.miss{animation:none}.hp-tile{transition:none}}
.hp-summary{width:100%;max-width:460px;margin:4px 0 18px;text-align:left}
.hp-summary h2{margin:0 0 8px;font-size:15px}
.hp-summary ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.hp-summary li{display:flex;justify-content:space-between;gap:12px;padding:9px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:14px}
.hp-summary li span{color:var(--muted);text-align:end}

.letter-slots{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.letter-slot{min-width:38px;height:50px;padding:0 6px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:11px;background:#fff;font-size:23px;font-weight:800}
.letter-slot.blank.empty{border-style:dashed;border-color:var(--blue);color:var(--blue);background:#f3f7ff}
.letter-slot.blank.filled{border-color:var(--blue);background:#e8f0ff;color:var(--blue-dark)}
.letter-slot.blank.right{background:#eaf7f0;border-color:#9ed0b7;color:#278360}
.letter-slot.blank.wrong{background:#fff0ee;border-color:#e7b9b2;color:#b56358}
.letter-keys{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;max-width:460px}
.letter-key{min-width:46px;height:46px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--navy);font-weight:800;font-size:18px;font-family:inherit;cursor:pointer;transition:background .15s,transform .15s}
.letter-key:hover:not(:disabled){background:#f3f7ff;border-color:var(--blue)}
.letter-key:active:not(:disabled){transform:scale(.95)}
.letter-key:disabled{opacity:.4;cursor:default}
.letter-key.wide{font-size:14px;color:var(--muted)}

.verb-page{max-width:860px}
.verb-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 14px;padding:0;border:0;background:none;font:inherit;cursor:pointer}
.verb-hint{margin:14px 0;font-size:13px;color:var(--muted)}
.verb-forms{display:block;margin-top:3px;font-size:12px;color:var(--muted)}
.verb-status.known{background:#eaf7f0;color:#278360}.verb-status.gap{background:#fff0ee;color:#b56358}.verb-status.learning{background:#e8f0ff;color:var(--blue-dark)}
.verb-empty{padding:18px 4px}
.verb-title{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}.verb-title h1{margin:2px 0}.verb-title p{margin:0;color:var(--muted)}
.verb-headlines{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin-bottom:18px}
.verb-headline{display:flex;flex-direction:column;align-items:center;gap:3px;padding:14px 8px;border-radius:14px;background:#eef4ff;text-align:center}.verb-headline strong{font-size:19px;color:var(--blue-dark)}.verb-headline span{font-size:11px;font-weight:700;color:var(--muted)}
.verb-timeline{display:flex;justify-content:space-between;margin:6px 2px 8px;font-size:11px;font-weight:800;letter-spacing:.06em;color:var(--muted)}.verb-timeline span:nth-child(2){color:var(--blue)}
.verb-use{margin:14px 0;font-size:14px;color:var(--muted)}
.verb-person{width:78px;flex-shrink:0;font-size:13px;color:var(--muted)}
.verb-page .feature-actions{margin-top:22px}
.gap-sentence{margin:0;max-width:520px;font-size:clamp(20px,5vw,26px);font-weight:700;line-height:1.5;color:var(--navy)}
.gap-blank{display:inline-block;min-width:3.2em;margin:0 .15em;border-bottom:3px dotted var(--blue);color:var(--blue);text-align:center;letter-spacing:.1em}
.gap-fill{margin:0 .15em;padding:0 .3em;border-radius:8px;background:#e8f0ff;color:var(--blue-dark)}
.gap-fill.right{background:#eaf7f0;color:#278360}
.gap-fill.wrong{background:#fff0ee;color:#b56358}
.listen-button{width:96px;height:96px;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:#e8f0ff;color:var(--blue);cursor:pointer;box-shadow:0 8px 24px #2563eb22;transition:transform .15s}
.listen-button svg{width:38px;height:38px}
.listen-button:active{transform:scale(.94)}

/* Card swipe: the card follows the finger; a card past the threshold flies off the side it was thrown to. */
.study-card.swipeable{touch-action:pan-y;cursor:grab;user-select:none;will-change:transform}
.study-card.swipeable.dragging{cursor:grabbing;transition:none}
.study-card.swipeable.settling{transition:transform .2s ease-out}
.study-card.swipeable.leaving{transition:transform var(--swipe-exit,.22s) ease-in,opacity var(--swipe-exit,.22s) ease-in;opacity:0}
.study-card.swipeable.hint-right{box-shadow:0 5px 0 #9ed0b7,0 14px 35px #24b47e30}
.study-card.swipeable.hint-left{box-shadow:0 5px 0 #e7b9b2,0 14px 35px #dd5b4a26}
.swipe-hint{margin:12px 0 0;text-align:center;font-size:12px;color:var(--muted)}
@media(prefers-reduced-motion:reduce){.study-card.swipeable.settling,.study-card.swipeable.leaving,.ws-cell,.letter-key,.listen-button{transition:none}}
@media(max-width:480px){.topbar-tools .auth-lang{max-width:72px;padding-inline:8px;text-overflow:ellipsis}}
@media(max-width:480px){.game-wrap{min-height:calc(100vh - 150px)}.letter-slot{min-width:34px;height:46px;font-size:21px}}
