:root {
  --bg: #f4f0e8;
  --panel: #fffdf8;
  --text: #24231f;
  --muted: #777269;
  --line: #ddd6ca;
  --accent: #385f4d;
  --accent-hover: #2f5141;
  --accent-soft: #e3ece7;
  --danger: #9b423c;
  --success: #2f6a4d;
  --shadow: 0 18px 45px rgba(41, 37, 31, .07);
  --segmented-bg: #efebe3;
  --suggest-hover: #d9e7df;
  --radius: 22px;
}

html[data-theme="dark"] {
  --bg: #171916;
  --panel: #22241f;
  --text: #f2f0e9;
  --muted: #aaa89f;
  --line: #3a3d36;
  --accent: #91b9a5;
  --accent-hover: #a6cbb8;
  --accent-soft: #2a3931;
  --danger: #e08e86;
  --success: #93c9aa;
  --shadow: 0 18px 45px rgba(0, 0, 0, .22);
  --segmented-bg: #2d302a;
  --suggest-hover: #33483d;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .18s ease, color .18s ease;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, .answer-erase:focus-visible { outline: 3px solid rgba(56, 95, 77, .25); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 52px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 8px 2px 30px; }
.brand { color: var(--text); text-decoration: none; font-weight: 780; letter-spacing: -.05em; font-size: clamp(42px, 5.4vw, 54px); line-height: .95; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 10px 6px; font-weight: 650; }

.view { animation: fade .22s ease; }
@keyframes fade { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
#loadingView { text-align: center; padding: 70px 28px; max-width: 620px; margin: 50px auto; }
#loadingView h1 { font-size: clamp(28px, 6vw, 42px); margin: 16px 0 10px; letter-spacing: -.04em; }
#loadingView p { line-height: 1.55; }
.loader { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { padding: 34px 2px 30px; }
.eyebrow { margin: 0 0 11px; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; color: var(--accent); }
.hero h1, .result-head h1 { margin: 0; max-width: 780px; font-size: clamp(38px, 7vw, 72px); line-height: .98; letter-spacing: -.055em; font-weight: 760; }
.lead { max-width: 700px; font-size: clamp(17px, 2.5vw, 20px); color: var(--muted); line-height: 1.55; margin: 22px 0 0; }

.settings-card { overflow: hidden; }
.setting-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(420px, 1.25fr); gap: 24px; align-items: center; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h2 { margin: 0 0 5px; font-size: 17px; }
.setting-row p { margin: 0; color: var(--muted); font-size: 14px; }
.segmented { display: flex; width: 100%; flex-wrap: nowrap; gap: 6px; padding: 4px; border-radius: 14px; background: var(--segmented-bg); }
.segmented label { position: relative; flex: 1 1 0; min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100%; text-align: center; padding: 10px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 650; transition: .15s ease; }
.segmented input:checked + span { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.segmented input:focus-visible + span { outline: 3px solid rgba(56,95,77,.22); }

.primary, .secondary { border: 0; border-radius: 14px; min-height: 48px; padding: 0 20px; font-weight: 720; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--text); background: transparent; border: 1px solid var(--line); }
.big { min-height: 56px; padding: 0 26px; font-size: 16px; }
#startButton { margin-top: 20px; width: 100%; }
.dictionary-load-warning { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 12px 16px; color: var(--danger); font-size: 14px; }

.game-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.game-meta > div { border-top: 1px solid var(--line); padding: 15px 4px 0; display: flex; flex-direction: column; gap: 3px; }
.meta-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 760; }
.game-meta strong { font-size: 24px; letter-spacing: -.03em; }
#timerBox.urgent strong { color: var(--danger); }

.source-wrap { text-align: center; padding: 66px 0 34px; }
.source-word { margin: 0; font-size: clamp(38px, 8vw, 72px); line-height: 1; letter-spacing: .035em; text-transform: uppercase; }
.letter-tiles { --tile-gap: 7px; --tile-hit-y: 6px; display: flex; justify-content: center; flex-wrap: wrap; margin: calc(24px - var(--tile-gap) / 2) 0 calc(var(--tile-gap) / -2); }
/* Кнопка шире и выше видимой плашки: нажатие попадает и в промежутки между буквами.
   Плашку рисует ::before; поля кнопки по горизонтали заменяют прежний gap. */
.letter-tile { --tile-w: 43px; --tile-h: 48px; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; isolation: isolate; width: calc(var(--tile-w) + var(--tile-gap)); height: calc(var(--tile-h) + 2 * var(--tile-hit-y)); margin: calc(var(--tile-gap) / 2 - var(--tile-hit-y)) 0; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 760; font-size: 19px; }
.letter-tile::before { content: ''; position: absolute; inset: var(--tile-hit-y) calc(var(--tile-gap) / 2); z-index: -1; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: 0 4px 12px rgba(40,36,31,.04); transition: background-color .18s ease, border-color .18s ease, transform .12s ease; }
/* Цель касания — сама плитка, а не буква внутри. */
.letter-tile > span, .answer-erase > span { pointer-events: none; }
.letter-tile:hover::before { border-color: #b9b1a4; }
.letter-tile:focus-visible { outline: 0; }
.letter-tile:focus-visible::before { outline: 3px solid rgba(56, 95, 77, .25); outline-offset: 2px; }
/* Подсветка касания iOS закрашивала бы всю зону нажатия серым квадратом. */
.letter-tile { -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.letter-tile.dragging { transform: translateY(-3px); cursor: grabbing; }
.letter-tile.dragging::before { border-color: var(--accent); box-shadow: 0 8px 18px rgba(40,36,31,.14); }
/* Нажатие заметно и при быстром тапе: JS держит класс не меньше 120 мс (SL-181). */
.letter-tile.pressed { color: var(--panel); transition: none; }
.letter-tile.pressed::before { background: var(--accent); border-color: var(--accent); box-shadow: none; transform: scale(.9); transition: transform .06s ease; }
/* На телефоне палец закрывает плашку: над ним всплывает крупная буква, как на клавиатуре
   айфона, а плашка светлеет и вдавливается. На компьютере — заливка выше (SL-181). */
@media (hover: none) {
  .letter-tile.pressed { z-index: 5; color: var(--text); }
  .letter-tile.pressed::before { background: var(--accent-soft); border-color: var(--accent); transform: scale(.94); }
  .letter-tile.pressed > span { position: absolute; left: 50%; bottom: calc(100% - 2px); transform: translateX(-50%); display: flex; align-items: center; justify-content: center; width: 58px; height: 66px; border-radius: 14px; background: var(--accent); color: var(--panel); font-size: 32px; box-shadow: 0 10px 24px rgba(40,36,31,.28); }
}
.letter-order-reset { display: block; margin: 6px auto 0; padding: 4px 8px; font-size: 13px; visibility: hidden; }
.letter-order-reset.is-visible { visibility: visible; }

.answer-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 650px; margin: 0 auto; }
.answer-form input { width: 100%; min-width: 0; height: 54px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 0 18px; font-size: 18px; box-shadow: inset 0 1px 2px rgba(0,0,0,.02); }
.answer-form input::placeholder { color: #aaa49a; }
.answer-field { position: relative; min-width: 0; }
.answer-form .answer-field input { padding-right: 92px; }
/* Зона «⌫» шире значка и заходит в поле и чуть выше него: промах рядом
   стирает букву, а не открывает клавиатуру (SL-181). Значок на прежнем месте. */
.answer-erase { cursor: pointer; position: absolute; top: 0; right: 0; display: flex; align-items: center; justify-content: flex-end; width: 88px; height: 100%; padding: 0 17px 0 0; border: 0; border-radius: 0 14px 14px 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.answer-erase::after { content: ''; position: absolute; inset: -12px 0 -4px 0; }
.answer-erase:hover, .answer-erase.pressed { color: var(--text); }
.answer-erase.pressed { background: linear-gradient(to right, transparent, var(--accent-soft) 40%); }
#answerInput:placeholder-shown + .answer-erase, #answerInput:disabled + .answer-erase { display: none; }
/* Пока «⌫» нажата, она не исчезает, даже если стёрла последнюю букву:
   иначе отпускание пальца попадёт в поле и откроет клавиатуру. */
#answerInput:placeholder-shown + .answer-erase.pressed { display: flex; }
.feedback { height: 28px; margin: 10px auto 0; text-align: center; font-size: 14px; max-width: 650px; }
.feedback.success { color: var(--success); }
.feedback.error { color: var(--danger); }
.daily-time-status { margin: 12px auto 0; text-align: center; font-size: 15px; font-weight: 650; color: var(--danger); max-width: 650px; }

.found-section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); min-height: 150px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.muted { color: var(--muted); }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 14px; }
/* Слово на проверке — того же размера, что найденные, чтобы ряд не сбивался. */
.word-chip.pending-word { border-style: dashed; color: var(--muted); font-size: inherit; display: inline-flex; align-items: baseline; gap: 6px; }
.word-chip.pending-word small { font-size: 12px; }
.held-word { display: inline-flex; align-items: center; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft); }
.held-word .word-chip { border-color: transparent; background: transparent; padding-right: 10px; }
.held-word-undo { appearance: none; position: relative; width: 40px; align-self: stretch; padding: 0 4px 0 0; border: 0; border-left: 1px solid var(--line); border-radius: 0 999px 999px 0; background: transparent; color: var(--muted); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.held-word-undo::after { content: ''; position: absolute; inset: -5px -5px -5px 0; }
.held-word-undo:hover { color: var(--danger); }
.held-word-undo:focus-visible { outline: 3px solid rgba(56,95,77,.22); outline-offset: -3px; }
.empty-state { color: var(--muted); font-size: 14px; }
.game-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 36px; }

.result-head { padding: 44px 0 30px; }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.stat-card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.stat-card strong { font-size: 34px; letter-spacing: -.04em; }
.result-words-card { padding: 24px; margin-top: 12px; box-shadow: none; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.footer { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 28px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }

@media (max-width: 700px) {
  .shell { width: min(100% - 22px, 920px); padding-top: 12px; }
  .topbar { padding-bottom: 14px; }
  .hero { padding-top: 24px; }
  .setting-row { grid-template-columns: 1fr; gap: 15px; padding: 21px 18px; }
  .segmented { width: 100%; }
  .segmented label { flex: 1 1 auto; }
  .segmented span { text-align: center; padding: 11px 10px; }
  .source-wrap { padding: 46px 0 28px; }
  .letter-tile { --tile-w: 38px; --tile-h: 43px; }
  .answer-form { grid-template-columns: 1fr; }
  .answer-form .primary { height: 50px; }
  .game-actions { align-items: stretch; flex-direction: column; }
  .game-actions > * { width: 100%; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .stat-card:last-child { grid-column: 1 / -1; }
  .result-actions { grid-template-columns: 1fr; }
}

/* Collective mode additions */
.top-actions { display:flex; align-items:center; gap:14px; flex-wrap:wrap; justify-content:flex-end; }
.mode-picker { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:0 0 18px; }
.mode-picker label { position:relative; }
.mode-picker input { position:absolute; opacity:0; pointer-events:none; }
.mode-picker span { display:flex; min-height:94px; flex-direction:column; justify-content:center; gap:6px; padding:18px 20px; border:1px solid var(--line); border-radius:18px; background:var(--panel); cursor:pointer; }
.mode-picker strong { font-size:17px; }
.mode-picker small { color:var(--muted); font-size:14px; line-height:1.4; }
.mode-picker input:checked + span { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); background:var(--accent-soft); }
.collective-box { padding:28px; margin-top:16px; }
.collective-box h2 { margin:0 0 8px; font-size:24px; }
.field-label { display:block; margin:20px 0 7px; font-weight:700; font-size:14px; }
.field-input { width:100%; min-height:50px; padding:0 14px; border:1px solid var(--line); border-radius:13px; background:var(--panel); color:var(--text); font-size:16px; }
.full { width:100%; }
.collective-box .full { margin-top:22px; }
.collective-game-badge { width:max-content; max-width:100%; margin:18px 0 4px; padding:8px 11px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-weight:700; font-size:13px; }
.result-grid-two { grid-template-columns:1fr 1fr; }
.history-list { display:grid; gap:14px; margin:28px 0 22px; }
.history-card { background:var(--panel); border:1px solid var(--line); border-radius:18px; overflow:hidden; }
.history-card-head { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:18px 20px; border-bottom:1px solid var(--line); }
.history-card-head h2 { margin:0; font-size:20px; }
.history-word-number { color:var(--muted); font-size:13px; font-weight:700; }
.history-results { display:grid; }
.history-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:16px; align-items:center; padding:13px 20px; border-top:1px solid var(--line); }
.history-row:first-child { border-top:0; }
.history-player { font-weight:700; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.history-value { color:var(--muted); white-space:nowrap; }
.history-empty { padding:16px 20px; color:var(--muted); }
@media (max-width: 680px) {
  .mode-picker { grid-template-columns:1fr; }
  .history-row { grid-template-columns:1fr auto; }
  .history-row .history-value:last-child { grid-column:1 / -1; }
}

/* Dictionary definitions */
.dictionary-word { cursor:help; text-decoration-line:underline; text-decoration-style:dotted; text-decoration-color:#aaa49a; text-underline-offset:4px; }
.word-chip-button { appearance:none; font:inherit; color:inherit; cursor:help; }
.word-chip-button:focus-visible, .dictionary-word:focus-visible { outline:3px solid rgba(56,95,77,.22); outline-offset:2px; }
.definition-popover { position:fixed; z-index:1000; display:flex; flex-direction:column; width:min(360px, calc(100vw - 20px)); max-height:var(--definition-viewport-height,calc(100dvh - 20px)); padding:14px 16px; border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:0 14px 40px rgba(40,36,31,.18); color:var(--text); }
.definition-popover strong { display:block; margin-bottom:7px; font-size:14px; letter-spacing:.04em; }
.definition-heading { display:flex; align-items:center; gap:0; flex-shrink:0; margin-bottom:7px; }
.definition-heading-label { flex:1; min-width:0; }
.definition-heading strong { margin:0; overflow-wrap:anywhere; }
.definition-copy-status { display:block; min-height:16px; font-size:11px; line-height:16px; text-align:right; color:var(--accent); }
.definition-copy { display:flex; align-items:center; justify-content:center; flex-shrink:0; width:44px; height:44px; padding:6px; border:0; border-radius:10px; background:transparent; color:var(--accent); }
@media (hover:hover) and (pointer:fine) { .definition-copy { width:32px; } }
.definition-copy:hover:not(:disabled) { background:var(--accent-soft); }
.definition-copy:disabled { opacity:.4; cursor:default; }
.definition-copy svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.definition-copy .definition-copy-confirmed, .definition-copy.copied .definition-copy-icon { display:none; }
.definition-copy.copied .definition-copy-confirmed { display:block; }
/* Длинный список значений прокручивается; слово, источник и кнопка остаются на экране. */
.definition-text { min-height:0; overflow-y:auto; overscroll-behavior:contain; font-size:14px; line-height:1.5; }
.definition-senses { margin:0; padding-left:1.9em; }
.definition-senses li + li { margin-top:6px; }
.definition-labels { color:var(--muted); font-style:italic; }
.definition-sources { flex-shrink:0; margin-top:9px; color:var(--muted); font-size:11px; line-height:1.4; }
.definition-source-toggle { padding:0; border:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.definition-source-toggle:hover { color:var(--text); }
.definition-source-toggle { display:inline-flex; align-items:center; gap:2px; }
.definition-source-chevron { flex:none; width:14px; height:14px; background:currentColor; -webkit-mask:var(--chevron-mask); mask:var(--chevron-mask); transform:rotate(-90deg); transition:transform .15s; }
.definition-source-toggle[aria-expanded="true"] .definition-source-chevron { transform:none; }
.definition-source-list { display:grid; grid-template-columns:fit-content(45%) minmax(0,1fr); gap:3px 10px; overflow-wrap:anywhere; margin:6px 0 0; }
.definition-source-list dd { margin:0; color:var(--text); }
.definition-example { display:block; margin-top:4px; color:var(--muted); font-size:.95em; }
/* SL-179: свёрнутый блок «Происхождение» под значениями; текст — цитата источника. */
/* Свёрнутая строка оформлена как «Источники» и стоит вплотную над ними. */
.definition-etymology { margin-top:9px; }
.definition-etymology-toggle { display:inline-flex; align-items:center; gap:2px; padding:0; border:0; background:none; color:var(--muted); font:inherit; font-size:11px; line-height:1.4; text-align:left; cursor:pointer; }
.personal-word-definition .definition-etymology-toggle { font-size:12px; }
.definition-text:has(.definition-etymology) + .definition-sources, .definition-text:has(.definition-etymology) + .personal-word-sources { margin-top:4px; }
.definition-etymology-toggle:hover { color:var(--text); }
.definition-etymology-toggle[aria-expanded="true"] .definition-source-chevron { transform:none; }
.definition-etymology-body { margin-top:6px; font-size:13px; line-height:1.5; }
.definition-etymology-body p { margin:0; }
.definition-etymology-body p + p { margin-top:6px; }
.definition-etymology-see { color:var(--muted); font-style:italic; }
.definition-etymology-note { color:var(--muted); font-size:.95em; }
.definition-etymology-body abbr { text-decoration:underline dotted; text-underline-offset:2px; cursor:help; }
.definition-etymology-ref, .definition-etymology-expansion { color:var(--muted); }


/* v5: аккаунт, слово дня, предложения слов */
textarea.field-input{resize:vertical;min-height:92px}
.top-actions{flex-wrap:wrap;justify-content:flex-end}
.mode-picker{grid-template-columns:repeat(3,minmax(0,1fr))}
#dailyBox .secondary.full{margin-top:10px}
#dailyLeaderboard{margin-top:16px}
.account-inline{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.daily-rank-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.daily-rank-row:last-child{border-bottom:0}
@media (max-width:720px){
  .mode-picker{grid-template-columns:1fr}
  .daily-rank-row{grid-template-columns:minmax(0,1fr) auto}
  .daily-rank-row .daily-score{display:none}
}

/* v7 adjustments */
.hero-minimal{display:none}.form-card{padding:28px}.form-card .field-label:first-child{margin-top:0}.form-card .field-input{display:block}.form-card .field-input + .field-label{margin-top:18px}.form-card .feedback{max-width:none;margin-top:14px}.field-input{padding:12px 14px}.topbar{gap:20px;flex-wrap:wrap}.brand{padding-left:2px}.collective-box,.history-card,.settings-card,.stat-card,.result-words-card{overflow:hidden}.collective-box p{line-height:1.55}@media (max-width:700px){.hero-minimal{padding-top:12px}.form-card{padding:20px}.shell{padding-bottom:40px}}

/* v12 UI cleanup */
#dailyAccountNote:empty{display:none}.mode-picker{margin:0 0 22px}.collective-box p,.settings-card p{line-height:1.5}@media (max-width:700px){.brand{font-size:48px}.topbar{align-items:flex-start}.top-actions{width:100%;justify-content:flex-start}.segmented{flex-wrap:nowrap}}

/* v13 profile and personal dictionary */
.suggest-action{border:1px solid rgba(56,95,77,.28);background:var(--accent-soft);border-radius:999px;padding:10px 14px}
.suggest-action:hover{background:var(--suggest-hover)}
.profile-card{padding:26px 28px;box-shadow:none}
.text-button.compact{padding:4px 8px;font-size:13px}
.inline-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
.profile-feedback{height:auto;min-height:20px;margin:8px 0 0;text-align:left}
.profile-section-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}
.profile-section-head h2{margin:0;font-size:24px;letter-spacing:-.02em}
.profile-section-head p.muted{margin:6px 0 0}
.profile-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.profile-stats .stat-card{padding:16px}
.profile-stats .stat-card strong{font-size:30px}
.profile-note{margin:14px 0 0;font-size:13px}

.dictionary-add-row{margin-bottom:2px}

.personal-dictionary-empty{padding:16px 0;color:var(--muted);font-size:14px}
.profile-bottom-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.definition-save{margin-top:12px;width:100%;min-height:38px;border:1px solid var(--line);border-radius:10px;background:var(--accent-soft);color:var(--accent);font-weight:720;transition:background-color .18s ease,color .18s ease}
.definition-save.saved{background:transparent;color:var(--muted)}
.definition-save.saved::before{content:'✓ '}
@media (prefers-reduced-motion: reduce){.definition-save{transition:none}}
@media(max-width:760px){.profile-stats{grid-template-columns:1fr 1fr}.inline-form{grid-template-columns:1fr}.inline-form button{width:100%}}

.personal-sync-note{font-size:12px}.logged-out-dictionary-note{font-size:12px}

/* v14 separated account, dictionary and settings */
.account-name{margin:8px 0 4px;font-size:32px;letter-spacing:-.03em}.settings-login-note{margin:0 0 18px}.top-actions .text-button{white-space:nowrap}@media(max-width:760px){.top-actions{gap:6px}.top-actions .text-button{font-size:14px;padding:9px 8px}.suggest-action{padding:9px 11px}}

/* v15 theme + cleanup */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light}
.card,.field-input,.answer-form input,.letter-tile,.word-chip,.segmented span,.primary,.secondary,.text-button{transition:background-color .18s ease,border-color .18s ease,color .18s ease}
.settings-account-card{margin-bottom:16px}
#settingsView>.result-head{padding-bottom:24px}
#accountView>.result-head{padding-bottom:24px}
@media(max-width:700px){.top-actions{row-gap:4px}}

/* v16 login without email */
.auth-hint{margin:14px 0 2px;font-size:13px;line-height:1.5}.profile-login-note{margin:12px 0 0;font-size:13px;line-height:1.5}

/* v18 collective autosave and statistics */
.history-player-card{padding:16px 20px;border-top:1px solid var(--line)}
.history-player-card:first-child{border-top:0}
.history-player-summary{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:16px;align-items:center}
.history-word-list{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px;padding-top:12px;border-top:1px dashed var(--line)}
.history-word-list .word-chip{padding:6px 10px;font-size:13px}
.history-no-words{color:var(--muted);font-size:13px}
@media(max-width:680px){
  .history-player-summary{grid-template-columns:1fr auto}
  .history-player-summary .history-value:last-child{grid-column:1/-1}
}

/* v19 navigation, rankings, saved history and dictionary search */
:root{
  --rank-1-bg:#dcefe2;
  --rank-1-line:#78ad87;
  --rank-2-bg:#e7f2e9;
  --rank-2-line:#9bbda4;
  --rank-3-bg:#f0f6f1;
  --rank-3-line:#bfd3c4;
}
html[data-theme="dark"]{
  --rank-1-bg:#263e30;
  --rank-1-line:#6ca37c;
  --rank-2-bg:#28372d;
  --rank-2-line:#5e8068;
  --rank-3-bg:#29322c;
  --rank-3-line:#4f6656;
}
.nav-button{color:var(--text)}
.nav-button:hover{color:var(--accent)}
.account-menu-wrap{position:relative}
.account-menu-button{border:1px solid var(--line);border-radius:999px;padding:10px 14px;background:var(--panel)}
.account-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:1200;width:268px;padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}
.account-menu button{display:flex;align-items:center;gap:11px;width:100%;border:0;background:transparent;color:var(--text);text-align:left;padding:8px 10px;border-radius:9px;font-size:14px;font-weight:550;line-height:1.3}
.account-menu button:hover{background:var(--accent-soft)}
.account-menu .menu-icon{width:18px;height:18px;flex:none;fill:none;stroke:var(--muted);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.account-menu .menu-danger{color:var(--danger)}
.account-menu .menu-danger .menu-icon{stroke:currentColor}
.account-menu-section{margin-top:5px;padding-top:5px;border-top:1px solid var(--line)}
.account-menu-label{padding:6px 10px 3px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}

.dictionary-search-status{margin:10px 0 2px;font-size:13px}
.dictionary-search-results{display:grid;margin-top:10px;border-top:1px solid var(--line)}
.dictionary-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:start;padding:14px 0;border-bottom:1px solid var(--line)}
.dictionary-search-main{min-width:0}
.dictionary-search-word{display:inline-block;padding:0;margin:0 0 5px;font-size:17px;font-weight:760;color:var(--text)}
.dictionary-search-definition{margin:0;color:var(--muted);font-size:14px;line-height:1.45}
.dictionary-search-add{min-height:40px;padding:0 14px;font-size:13px}
.dictionary-search-add.saved{opacity:.7;cursor:default}

.history-days{gap:10px;margin-top:0}
.history-word-block{background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.history-word-summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto 24px;gap:18px;align-items:center;padding:15px 18px;cursor:pointer}
.history-word-summary::-webkit-details-marker{display:none}
.history-word-summary::after{content:'';width:20px;height:20px;background:var(--muted);-webkit-mask:var(--chevron-mask);mask:var(--chevron-mask);transition:transform .15s ease}
.history-word-block[open]>.history-word-summary::after{transform:rotate(180deg)}
.history-word-summary-left{display:flex;align-items:center;gap:12px;min-width:0}
.history-word-summary-left>strong{white-space:nowrap}
.history-source-pill{display:inline-flex;align-items:center;min-height:30px;padding:4px 11px;border-radius:999px;background:var(--segmented-bg);font-size:13px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-winner{display:grid;grid-template-columns:auto auto;gap:2px 8px;align-items:baseline;text-align:right}
.history-winner>span{grid-row:1/3;color:var(--accent);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.history-winner>strong{font-size:14px}
.history-winner>small{color:var(--muted);font-size:12px}
.history-word-body{border-top:1px solid var(--line);padding:12px}
.history-player-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));gap:10px;align-items:start}
.history-player-column{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:14px;min-width:0}
.history-player-column.rank-1{background:var(--rank-1-bg);border-color:var(--rank-1-line)}
.history-player-column.rank-2{background:var(--rank-2-bg);border-color:var(--rank-2-line)}
.history-player-column.rank-3{background:var(--rank-3-bg);border-color:var(--rank-3-line)}
.history-player-column-head{display:flex;justify-content:space-between;gap:10px;align-items:center}
.history-player-column-head strong{font-size:17px;overflow:hidden;text-overflow:ellipsis}
.history-player-id{min-width:0;display:flex;flex-direction:column}
.history-player-meta{display:flex;align-items:center;gap:5px;margin-top:2px;color:var(--muted);font-size:12px;font-weight:500;line-height:1.2}
.history-time-exhausted{flex:none;width:11px;height:11px;color:#2fb566}
.history-time-exhausted svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.history-time-left{font-variant-numeric:tabular-nums}
.history-place{white-space:nowrap;color:var(--accent);font-size:12px;font-weight:800}
.history-player-totals{display:grid;grid-template-columns:minmax(max-content,1fr) 1fr;margin-top:12px;padding-top:8px;border-top:1px solid rgba(120,120,110,.13)}
.history-player-totals>span{padding:10px 6px}
.history-player-totals>span+span{padding-left:12px;border-left:1px solid rgba(120,120,110,.13)}
.history-player-totals>span:first-child{padding-right:12px}
.history-player-totals strong{display:block;font-size:23px;line-height:1}
.history-player-totals small{display:block;margin-top:4px;color:var(--muted);font-size:11px}
.history-found-percent{color:var(--accent);white-space:nowrap}
.history-word-list{border-top:0;margin-top:10px;padding-top:0;gap:6px}
.history-word-list .word-chip{padding:5px 9px;font-size:12px;background:rgba(255,255,255,.52)}
html[data-theme="dark"] .history-word-list .word-chip{background:rgba(255,255,255,.05)}
.history-locked{color:var(--muted);font-size:12px;line-height:1.45}

@media(max-width:760px){
  .top-actions{width:100%;justify-content:flex-start;gap:4px}
  .nav-button{padding:8px 7px;font-size:13px}
  .account-menu{left:0;right:auto}
  .dictionary-search-row{grid-template-columns:1fr}
  .dictionary-search-add{width:100%}
  .history-player-grid{grid-template-columns:1fr}
}

/* v20 */
.mode-picker{align-items:stretch}
.mode-picker label{display:block;height:100%}
.mode-picker span{height:100%;min-height:118px;box-sizing:border-box}

.account-menu .account-menu-identity{gap:10px;padding:9px 10px;margin-bottom:5px;position:relative}
.account-menu .account-menu-identity::after{content:"";position:absolute;left:4px;right:4px;bottom:-5px;border-bottom:1px solid var(--line)}
.account-menu-avatar{width:34px;height:34px;flex:none;border-radius:50%;overflow:hidden;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:800}
.account-menu-avatar img{width:100%;height:100%;object-fit:cover}
.account-menu-identity-text{min-width:0;flex:1}
.account-menu-identity-text strong{display:block;font-size:15px;line-height:1.2;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-menu-identity-text > span{display:block;margin-top:2px;color:var(--muted);font-size:12px;font-weight:450;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-menu .account-menu-chevron{width:20px;height:20px;stroke-width:2.2}

.dictionary-head{align-items:flex-start;gap:18px}
.dictionary-scope{width:min(330px,100%);flex:0 0 auto}
.dictionary-result-badge{display:inline-flex;align-items:center;margin-left:8px;padding:3px 7px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:700;vertical-align:middle}

.stats-mode-tabs{display:grid;grid-template-columns:1fr 1fr;margin:0 0 16px;padding:4px;border:1px solid var(--line);border-radius:15px;background:var(--panel)}
.stats-mode-tabs button{border:0;background:transparent;color:var(--muted);padding:11px 14px;border-radius:11px;font-weight:750;cursor:pointer}
.stats-mode-tabs button.active{background:var(--accent-soft);color:var(--text);box-shadow:inset 0 0 0 1px var(--accent)}

.admin-users-list{display:grid;gap:8px;margin-top:14px}
.admin-user-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.admin-user-row:last-child{border-bottom:0}
.admin-user-meta{min-width:0}
.admin-user-meta strong{display:block}
.admin-user-meta span{display:block;margin-top:3px;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis}
.admin-user-actions{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.password-reset-copy-list{margin-top:16px}
.password-reset-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;margin-bottom:10px}

.daily-history-day{margin:0 0 12px}
.daily-history-summary{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--panel);cursor:pointer}
.daily-history-summary-left{display:flex;align-items:center;gap:10px;min-width:0}
.daily-history-source{font-weight:800;font-size:17px}
.daily-history-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));gap:10px;padding:10px 0 4px}
.daily-history-locked{padding:12px;color:var(--muted);font-size:13px}

@media(max-width:760px){
  .dictionary-head{display:block}
  .dictionary-scope{margin-top:12px;width:100%}
  .admin-user-row{grid-template-columns:1fr}
  .admin-user-row button{width:100%}
  .admin-user-actions{align-items:stretch}
  .mode-picker span{min-height:100px}
}

/* v20 reliability + inline word proposal */
.game-suggestion{max-width:650px;margin:2px auto 0;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:var(--accent-soft);display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}
.game-suggestion span{min-width:0;line-height:1.4}
.game-suggestion button{min-height:38px;padding:0 13px;white-space:nowrap;font-size:12px}

/* first three places: all green, with decreasing intensity */
:root{
  --rank-1-bg:#d7ecdc;
  --rank-1-line:#67a879;
  --rank-2-bg:#e4f0e6;
  --rank-2-line:#8fba99;
  --rank-3-bg:#eef5ef;
  --rank-3-line:#b1cdb8;
}
html[data-theme="dark"]{
  --rank-1-bg:#284333;
  --rank-1-line:#67a879;
  --rank-2-bg:#293a30;
  --rank-2-line:#648d70;
  --rank-3-bg:#29342d;
  --rank-3-line:#526d59;
}

@media(max-width:760px){
  .game-suggestion{align-items:stretch;flex-direction:column}
  .game-suggestion button{width:100%}
}

/* v20 polish: all three game mode cards have identical dimensions */
.mode-picker > label{display:flex;min-width:0}
.mode-picker > label > span{width:100%;height:100%;min-height:112px;box-sizing:border-box}
@media (max-width:720px){.mode-picker > label > span{min-height:104px}}

/* v21 visual system */
:root{
  --rank-1-bg:#cfe8d5;
  --rank-1-line:#3e7f58;
  --rank-2-bg:#e0efe3;
  --rank-2-line:#75a684;
  --rank-3-bg:#eef6f0;
  --rank-3-line:#a8c5b0;
  --soft-green-button:rgba(126,174,143,.18);
  --soft-green-button-hover:rgba(126,174,143,.28);
}
html[data-theme="dark"]{
  --rank-1-bg:#294b36;
  --rank-1-line:#78b18a;
  --rank-2-bg:#263c2e;
  --rank-2-line:#648d71;
  --rank-3-bg:#222f27;
  --rank-3-line:#4f6957;
  --soft-green-button:rgba(116,174,137,.18);
  --soft-green-button-hover:rgba(116,174,137,.28);
}

/* Navigation */
.topbar{align-items:center;padding-bottom:34px}
.top-actions{gap:8px}
.nav-button{position:relative;color:var(--text);padding:10px 12px;border-radius:999px;font-weight:720;transition:background .15s ease,color .15s ease}
.nav-button:hover{background:rgba(56,95,77,.06)}
.nav-button.active{color:var(--accent);background:var(--accent-soft)}
.nav-button.active::after{content:"";position:absolute;left:18px;right:18px;bottom:3px;height:2px;border-radius:999px;background:var(--accent)}
.account-nav-button{border:1px solid var(--line);padding-inline:17px;background:var(--panel)}
.account-nav-button.active{border-color:rgba(56,95,77,.3)}
.brand{cursor:pointer}

/* Page headings: deliberately compact */
.result-head,.compact-head{padding:20px 0 20px}
.hero h1,.result-head h1,.compact-head h1{font-size:clamp(30px,4.3vw,46px);line-height:1.04;letter-spacing:-.045em;max-width:900px}
.result-head .eyebrow{margin-bottom:8px}
.lead,.muted,.setting-row p,.collective-box p{word-spacing:.07em;line-height:1.55}
.compact-head .lead{margin-top:12px}

/* Home cards: perfectly equal */
.mode-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch}
.mode-picker>label{display:flex;min-width:0;height:100%}
.mode-picker>label>span{width:100%;height:100%;min-height:116px;padding:20px 22px;box-sizing:border-box;justify-content:center}
.mode-picker strong{font-size:18px;line-height:1.2}
.mode-picker small{font-size:14px;line-height:1.45;word-spacing:.05em}

/* Account */

.auth-card{padding:22px 24px}.auth-card .auth-invite-field .field-label{margin-top:18px}.auth-actions{display:grid;margin-top:20px}.auth-mode-button{display:block;margin:10px auto 0}
/* «Не помню пароль» (SL-76) — в строке подписи пароля, справа. */
.auth-password-label{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:18px 0 7px}.auth-password-label .field-label{margin:0}.auth-password-label .text-button{margin-right:-8px}

/* Dictionary */

.dictionary-scope{height:48px}
.dictionary-search-status{min-height:18px;margin:8px 2px 0;font-size:12px}
.dictionary-search-results{margin-top:4px}
.dictionary-search-row{grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:11px 2px;gap:14px}
.dictionary-search-word{font-size:16px;margin-bottom:3px}
.dictionary-search-definition{font-size:13px;line-height:1.38}
.dictionary-search-add{min-height:38px;border:1px solid rgba(91,139,108,.18);background:var(--soft-green-button);color:var(--accent);font-weight:750}
.dictionary-search-add:hover:not(:disabled){background:var(--soft-green-button-hover)}
.dictionary-search-add.saved{background:transparent;color:var(--muted);border-color:var(--line)}
/* Недостающее слово — первая строка выдачи (SL-171): свёрнута до кнопки, поле растёт с текстом. */
.dictionary-missing{display:grid;gap:8px;margin-top:4px;padding:11px 12px;border-radius:10px;background:var(--accent-soft)}
.dictionary-missing-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px}
.dictionary-missing-copy{min-width:0}
.dictionary-missing-word{display:block;margin-bottom:3px;font-size:16px;font-weight:760}
.dictionary-missing-copy p{margin:0;color:var(--muted);font-size:13px;line-height:1.38}
.dictionary-missing-form{display:flex;align-items:flex-start;gap:8px}
.dictionary-missing-definition{flex:1 1 auto;min-width:0;min-height:38px;max-height:120px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);font:inherit;font-size:14px;line-height:1.35;resize:none;overflow-y:auto}
.dictionary-missing-form button{flex:none;min-height:38px;padding:0 14px;font-size:13px}
.dictionary-missing-form .dictionary-search-add:disabled{opacity:.5;cursor:default}
.dictionary-missing.sent .dictionary-missing-word,.dictionary-missing.sent .dictionary-missing-form{display:none}
.dictionary-missing.sent .dictionary-missing-copy p{color:var(--text)}

.personal-sync-note{font-size:11px;margin:2px 0 0}

.personal-dictionary-empty{padding:18px;color:var(--muted);font-size:13px}

/* Admin moderation */
.admin-empty{padding:20px;box-shadow:none}
.role-select{min-height:42px;min-width:190px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);padding:0 36px 0 12px;font-weight:680}
.admin-user-row{padding:10px 0}

/* Game inline proposal */
.game-suggestion{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:10px 12px}
.game-suggestion-copy{display:grid;grid-template-columns:minmax(150px,.8fr) minmax(220px,1.2fr);gap:10px;align-items:center;min-width:0}
.game-suggestion-definition{width:100%;min-height:38px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);padding:0 10px;font-size:12px}
.game-suggestion button{min-height:38px}
/* Заявка на возврат удалённого слова (SL-159): пояснение длиннее, поле определения под ним. */
.game-suggestion.restore-request{align-items:end}
.game-suggestion.restore-request .game-suggestion-copy{grid-template-columns:1fr;gap:8px}
/* Без поля определения (отправлено или заявку уже отклонили) пояснение занимает всю ширину. */
.game-suggestion-copy:has(> .game-suggestion-definition.hidden){grid-template-columns:1fr}

/* Statistics */
.stats-mode-tabs{margin-bottom:14px}
.history-word-summary{grid-template-columns:minmax(0,1fr) minmax(230px,310px) 20px;gap:14px;padding:13px 16px}
.history-winner{display:grid;grid-template-columns:72px minmax(80px,1fr) minmax(120px,auto);align-items:center;gap:10px;text-align:left}
.history-winner>span{grid-row:auto;font-size:11px;letter-spacing:.04em;text-align:right}
.history-winner>strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-winner>small{font-size:11px;text-align:right;white-space:nowrap}
.history-player-grid{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:9px}
.history-player-column{padding:13px;box-shadow:none}
.history-player-column-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.history-player-column-head strong{font-size:16px;white-space:nowrap}
.history-place{display:flex;justify-content:center;align-items:center;min-height:26px;border-radius:999px;background:rgba(56,95,77,.08);font-size:11px;text-align:center}
.rank-1 .history-place{background:#3e7f58;color:#fff}
.rank-2 .history-place{background:#83ad8e;color:#fff}
.rank-3 .history-place{background:#c0d8c6;color:#355a43}
.history-player-totals{margin-top:10px}
.history-player-totals>span{padding:4px 5px 2px 0}
.history-player-totals strong{font-size:21px}
.history-word-list{margin-top:8px;display:flex;flex-wrap:wrap;gap:5px}
.history-word-list .word-chip{padding:4px 8px;font-size:11px}

/* Footer */
.footer{padding-top:18px;border-top:1px solid rgba(120,114,105,.15)}
.footer{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:4px 12px}
.footer-link{border:0;background:transparent;padding:0;font:inherit;color:inherit;text-decoration:underline dotted;text-underline-offset:3px;cursor:pointer}
.footer-link:hover,.footer-link[aria-expanded="true"]{color:var(--text)}
.footer{position:relative}
.dictionary-info{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);z-index:50;width:min(560px,calc(100vw - 20px));max-height:min(65vh,540px);overflow:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;margin:0;padding:14px 16px;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(40,36,31,.18);text-align:left}
.dictionary-info dt{color:var(--muted)}
.dictionary-info dd{margin:0;color:var(--text);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.dictionary-info .dictionary-info-first-source{margin-top:4px;padding-top:10px;border-top:1px solid var(--line)}
.dictionary-info dt.dictionary-info-first-source{margin-right:-16px;padding-right:16px}

@media(max-width:760px){
  .topbar{align-items:flex-start}
  .brand{font-size:48px}
  .top-actions{width:100%;justify-content:flex-start;gap:2px}
  .nav-button{font-size:12px;padding:8px 8px}
  .account-nav-button{padding-inline:12px}
  .mode-picker{grid-template-columns:1fr}
  .mode-picker>label>span{min-height:92px}

  .dictionary-scope{width:100%}
  .dictionary-search-row{grid-template-columns:1fr auto}
  .dictionary-missing-form{flex-direction:column;align-items:stretch}

  .role-select{width:100%}
  .game-suggestion{grid-template-columns:1fr}
  .game-suggestion-copy{grid-template-columns:1fr}
  .game-suggestion button{width:100%}
  .history-player-grid{grid-template-columns:1fr}
}

/* v22 design polish */
:root{
  --rank-1-bg:#c8e4d0;
  --rank-1-line:#2f7450;
  --rank-2-bg:#e0efe4;
  --rank-2-line:#6da181;
  --rank-3-bg:#f0f7f2;
  --rank-3-line:#a8c9b2;
}
html[data-theme="dark"]{
  --rank-1-bg:#234c35;
  --rank-1-line:#72bd8b;
  --rank-2-bg:#263d30;
  --rank-2-line:#639879;
  --rank-3-bg:#252f29;
  --rank-3-line:#4e6d58;
}

/* Section titles are page labels, not hero headlines. */
.result-head,.compact-head{padding:14px 0 16px}
.result-head h1,.compact-head h1{font-size:clamp(27px,3.4vw,36px);line-height:1.08;letter-spacing:-.035em;max-width:760px}
.result-head .eyebrow,.compact-head .eyebrow{margin:0 0 6px;font-size:11px;letter-spacing:.18em;line-height:1.35}
.result-head .lead,.compact-head .lead{font-size:15px;line-height:1.65;word-spacing:.11em;letter-spacing:.005em}

/* More readable supporting copy throughout the interface. */
.setting-row p,.collective-box p,.muted{line-height:1.58;word-spacing:.10em;letter-spacing:.004em}

/* Moderation cards: consistent inner spacing and no clipped edges. */
.admin-actions{flex:0 0 auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding-left:2px}
.admin-actions .primary,.admin-actions .secondary{min-width:108px;min-height:42px;padding:0 15px}

/* Dictionary: compact saved rows and a deliberately soft save button. */
.dictionary-search-add{background:rgba(125,180,145,.17);border-color:rgba(75,125,94,.16);color:var(--accent)}
.dictionary-search-add:hover:not(:disabled){background:rgba(125,180,145,.25)}
/* В зелёной строке недостающего слова мягкая кнопка сливается с фоном: даём ей фон карточки. */
.dictionary-missing .dictionary-search-add{background:var(--panel);border-color:var(--line);color:var(--accent)}
.dictionary-missing .dictionary-search-add:hover:not(:disabled){border-color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,var(--panel))}

/* Every result card uses the same columns so names and places line up. */
.history-word-summary{grid-template-columns:minmax(0,1fr) 286px 20px;gap:14px;padding:13px 16px}
.history-winner{grid-template-columns:72px minmax(86px,1fr) 118px;gap:10px;align-items:center;text-align:left}
.history-winner>span{grid-row:auto;text-align:right;font-size:11px}
.history-winner>strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-winner>small{font-size:11px;text-align:right;white-space:nowrap}
.history-player-grid{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:9px;align-items:stretch}
.history-player-column{height:100%;padding:13px}
.history-player-column-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;min-height:28px}
.history-player-column-head strong{font-size:15px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-place{min-width:26px;min-height:26px;padding:0 7px;justify-self:end;display:flex;align-items:center;justify-content:center;border-radius:999px;font-size:12px;font-weight:820;text-align:center}
.rank-1 .history-place{background:#2f7450;color:#fff}
.rank-2 .history-place{background:#78aa88;color:#fff}
.rank-3 .history-place{background:#bdd8c5;color:#244a35}
.history-player-column.rank-1{box-shadow:inset 0 0 0 1px rgba(47,116,80,.16)}
.history-player-column.rank-2{box-shadow:inset 0 0 0 1px rgba(109,161,129,.12)}
.history-player-column.rank-3{box-shadow:inset 0 0 0 1px rgba(168,201,178,.12)}

@media(max-width:760px){
  .result-head h1,.compact-head h1{font-size:28px}
  .admin-actions{padding-left:0;justify-content:flex-start}
  .admin-actions .primary,.admin-actions .secondary{flex:1;min-width:0}
}

/* v23.1 — personal dictionary polish */

/* v23.2 — simplified top navigation and dictionary search */
.nav-button.active{background:rgba(104,161,126,.16);color:var(--accent);box-shadow:none}
.nav-button.active::after{display:none!important}

.account-menu-wrap{position:relative;display:flex;align-items:center}
.account-avatar-button{width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--accent);display:flex;align-items:center;justify-content:center;overflow:hidden;font:800 16px/1 inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}
.account-avatar-button:hover,.account-avatar-button.active,.account-menu-wrap:focus-within .account-avatar-button{background:var(--accent-soft);border-color:rgba(56,95,77,.28)}
.account-avatar-button img{width:100%;height:100%;object-fit:cover}
.account-nav-initial{display:flex;width:100%;height:100%;align-items:center;justify-content:center}
.account-menu{display:block;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-4px);transition:opacity .14s ease,transform .14s ease,visibility .14s ease,width .18s ease;right:0;left:auto;top:calc(100% + 8px)}
/* Account menu opens only by an explicit click on the avatar.
   Hover opening used to create an 8px dead zone between the avatar and menu,
   making the menu collapse while the pointer was moving into it. */
.account-menu-wrap.menu-open .account-menu{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0)}
.account-menu-wrap.menu-open .account-avatar-button{background:var(--accent-soft);border-color:rgba(56,95,77,.28)}

.dictionary-search-controls-single{display:block!important}

@media(max-width:760px){
  .topbar{align-items:center}
  .top-actions{width:auto;margin-left:auto;justify-content:flex-end;gap:4px}
  .nav-button{font-size:13px;padding:8px 9px}
  .account-avatar-button{width:40px;height:40px;font-size:14px}
  .account-menu{position:fixed;top:72px;right:12px;left:auto;width:min(268px,calc(100vw - 24px))}
}

/* v23.3 — saved dictionary: fixed word / definition / controls columns */

/* v23.4 — dictionary controls: expand first, safe delete second */

.personal-delete-confirm-overlay{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(34,32,28,.22);
  backdrop-filter:blur(2px);
}
.personal-delete-confirm{
  width:min(420px,100%);
  padding:24px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--panel);
  box-shadow:0 20px 60px rgba(34,32,28,.18);
}
.personal-delete-confirm h3{
  margin:0 0 10px;
  font-size:22px;
  line-height:1.25;
}
.personal-delete-confirm-text{
  margin:0;
  color:var(--muted);
  font-size:16px;
  line-height:1.5;
}
.personal-delete-confirm-text strong{color:var(--text)}
.personal-delete-confirm-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
}
.personal-delete-confirm-button{
  background:#a64137;
  border-color:#a64137;
  color:#fff;
}
.personal-delete-confirm-button:hover{background:#8f372f;border-color:#8f372f}
@media(max-width:760px){
  .personal-delete-confirm{padding:20px;border-radius:18px}
  .personal-delete-confirm h3{font-size:20px}
  .personal-delete-confirm-text{font-size:15px}
}

/* v23.5 — softer delete confirmation button */
.personal-delete-confirm-button{
  appearance:none;
  -webkit-appearance:none;
  min-height:48px;
  padding:0 22px;
  border:1px solid rgba(163,65,56,.24);
  border-radius:14px;
  background:rgba(163,65,56,.10);
  color:#963b34;
  font:inherit;
  font-weight:720;
  cursor:pointer;
  box-shadow:none;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease,transform .12s ease;
}
.personal-delete-confirm-button:hover{
  background:rgba(163,65,56,.17);
  border-color:rgba(163,65,56,.36);
  color:#84352f;
}
.personal-delete-confirm-button:active{transform:translateY(1px)}
.personal-delete-confirm-button:focus-visible{
  outline:3px solid rgba(163,65,56,.16);
  outline-offset:2px;
}

/* v23.8 — account/cloud state for personal dictionary */
.dictionary-sync-note{
  margin:4px 0 14px;
  min-height:1.35em;
  font-size:13px;
}

/* Единая галочка сворачивания (SL-142): та же форма, что у SVG-иконок M6 9l6 6 6-6. */
:root{--chevron-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}

/* SL-61 — выбор дня статистики: «Сегодня», «Вчера» и список трёх более ранних дней */
.history-day-picker{display:flex;gap:4px;width:max-content;max-width:100%;margin:0 0 14px;padding:4px;border:1px solid var(--line);border-radius:15px;background:var(--panel)}
.history-day-option{height:40px;display:flex;align-items:center;justify-content:center;padding:0 16px;border:0;border-radius:11px;background:transparent;color:var(--muted);font:inherit;font-weight:750;white-space:nowrap;cursor:pointer}
@media (hover:hover){.history-day-option:hover{color:var(--text)}}
.history-day-option.active{background:var(--accent-soft);color:var(--text);box-shadow:inset 0 0 0 1px var(--accent)}
.history-day-more{position:relative;padding:0}
.history-day-more select{height:100%;min-width:0;max-width:100%;padding:0 36px 0 16px;border:0;border-radius:11px;background:transparent;color:inherit;font:inherit;text-overflow:ellipsis;cursor:pointer;appearance:none;-webkit-appearance:none}
.history-day-more select:focus-visible{outline:3px solid rgba(56,95,77,.22)}
.history-day-more svg{position:absolute;right:12px;top:50%;width:20px;height:20px;margin-top:-10px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.history-day-more.custom-menu .dictionary-picker-button{display:block;border-radius:11px}
.history-day-more.custom-menu .dictionary-picker-button:focus-visible{outline:3px solid rgba(56,95,77,.22)}
.history-day-more.custom-menu select{pointer-events:none}
.dictionary-menu.history-day-menu{left:0;right:auto;min-width:160px;cursor:default}

/* v23.11 — recent dictionary additions and shared-dictionary management */

.dictionary-search-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}
.dictionary-word-remove{
  flex:0 0 auto;
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(110,110,105,.07);
  color:var(--muted);
  transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease;
}
.dictionary-word-remove svg{
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.dictionary-word-remove:hover{
  background:rgba(177,72,63,.12);
  border-color:rgba(177,72,63,.24);
  color:#a4433b;
}
.dictionary-word-remove:active{transform:translateY(1px)}

.recent-words-visibility{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:0 0 10px;
}
.recent-visibility-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:32px;
  color:var(--text);
  font-size:13px;
  font-weight:650;
  cursor:pointer;
}
.recent-visibility-toggle input{
  width:17px;
  height:17px;
  margin:0;
  accent-color:var(--accent);
}
.recent-visibility-current{
  color:var(--muted);
  font-size:12px;
}

@media(max-width:760px){
  .dictionary-search-actions{justify-content:space-between}
  .dictionary-search-add{flex:1 1 auto}

  .recent-words-visibility{align-items:flex-start;flex-direction:column}
}

/* v23.14: безопасное управление общим словарём */
.admin-dictionary-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 0;
  border-top:1px solid var(--line);
}
.admin-dictionary-row:first-child{border-top:0}
.admin-dictionary-word{min-width:0;display:grid;gap:3px}
.admin-dictionary-word strong{font-size:15px}
.admin-dictionary-word .muted{font-size:12px;line-height:1.35}
.admin-dictionary-remove{flex:0 0 auto}
@media (max-width:620px){
  .admin-dictionary-row{align-items:flex-start}
  .admin-dictionary-row .secondary{padding-left:10px;padding-right:10px}
}

/* Кнопки управления словом */
.admin-dictionary-actions{display:flex;gap:8px;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end}
.admin-dictionary-remove{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 38%,var(--line))}
.admin-dictionary-remove:hover{border-color:var(--danger)}
.personal-delete-confirm-button:disabled{opacity:.45;cursor:not-allowed}
@media (max-width:620px){.admin-dictionary-actions{width:100%;justify-content:stretch}.admin-dictionary-actions .secondary{flex:1 1 auto}}

/* v23.19 — personal dictionary sorting and exports */

.personal-dictionary-sort-label{
  font-size:12px;
  font-weight:700;
  color:var(--muted);
}
.personal-dictionary-sort{
  width:auto;
  min-width:170px;
  min-height:38px;
  padding-top:7px;
  padding-bottom:7px;
}

@media (max-width:640px){
  .personal-dictionary-sort{width:100%}
}

/* v23.20 — all-time added words history */

/* v23.21 — compact added-words controls, stable select arrows, hover account menu */

.recent-words-visibility{margin:4px 0 8px}

.personal-dictionary-sort{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236c6a64' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 8px center;
  background-size:20px 20px;
  padding-right:34px!important;
}
[data-theme="dark"] .personal-dictionary-sort{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23c8c4ba' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Menu is opened by hover/focus. JS keeps it alive briefly while the pointer crosses the gap. */
.account-menu-wrap.menu-open::after{
  content:"";
  position:absolute;
  top:100%;
  right:0;
  width:268px;
  height:10px;
  z-index:1199;
}


/* v23.31 — added words are visible to every signed-in participant; compact header */

/* v23.32 — invite-only registration */
.invite-code-input{text-transform:uppercase;letter-spacing:.04em}
.admin-invites-card{margin-top:14px}
.admin-invites-list{display:grid;gap:8px;margin-top:12px}
.admin-invite-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 0;border-top:1px solid var(--line)}
.admin-invite-row:first-child{border-top:0}
.admin-invite-meta{display:grid;gap:4px;min-width:0}
.admin-invite-meta span{font-size:13px;color:var(--muted)}
.invite-code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;letter-spacing:.08em;font-size:15px;overflow-wrap:anywhere}
.admin-invite-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
@media(max-width:620px){.admin-invite-row{align-items:flex-start;flex-direction:column}.admin-invite-actions{width:100%}.admin-invite-actions .secondary{flex:1}}

/* v23.33 — visible solution count */
.game-possible-count{margin:12px 0 0;color:var(--muted);font-size:14px;font-weight:650;text-align:center}
.game-possible-count:empty{display:none}

/* v24.0 — history vocabulary and winner layout */
.history-word-summary-left{
  min-width:0;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 10px;
}
.history-possible-count{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
/* SL-142: «170 слов · 4 участника» в строке слова. */
.history-word-meta{color:var(--muted);font-size:12px;font-weight:700;white-space:nowrap}
.history-possible-count+.history-participant-count::before{content:' · '}
.history-possible-details{
  margin:0 0 18px;
  padding:0 0 18px;
  border-bottom:1px solid var(--line);
}
/* Вся строка кликабельна; поля расширяют зону нажатия, не сдвигая строку. */
.history-possible-details>summary{
  margin:-8px 0;
  padding:8px 0;
  cursor:pointer;
  list-style:none;
  color:var(--accent);
  font-weight:800;
  font-size:13px;
  user-select:none;
}
.history-possible-details>summary::-webkit-details-marker{display:none}
.history-possible-details>summary{display:flex;align-items:center;gap:2px}
.history-possible-details>summary::after{content:'';flex:none;width:20px;height:20px;background:currentColor;-webkit-mask:var(--chevron-mask);mask:var(--chevron-mask);transition:transform .15s ease}
.history-possible-details[open]>summary::after{transform:rotate(180deg)}
.history-possible-list{margin-top:12px}
/* Слова, найденные самим игроком, приглушены: заметнее пропущенные. */
.word-chips .word-chip-own{background:transparent;border-color:transparent;opacity:.3}
/* SL-137: доступные слова, которые за день не нашёл ни один участник. */
:root{--missed-word-bg:#e2ece8}
html[data-theme="dark"]{--missed-word-bg:#2a3b37}
.word-chips .word-chip-missed{background:var(--missed-word-bg)}
.history-missed-legend{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:12px;color:var(--muted);font-size:12px;font-weight:500}
.history-missed-swatch{width:18px;height:11px;border-radius:999px;background:var(--missed-word-bg);border:1px solid var(--line);flex:none}
.history-winner{
  grid-template-columns:62px minmax(96px,1fr) minmax(118px,auto) !important;
  gap:8px !important;
  min-width:0;
}
.history-winner>span{
  text-align:left !important;
  justify-self:start;
}
.history-winner>strong{
  min-width:0;
  white-space:normal !important;
  overflow:hidden;
  text-overflow:clip !important;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  line-height:1.15;
  text-align:center;
  overflow-wrap:anywhere;
}
.history-winner>small{
  white-space:nowrap;
  text-align:right !important;
}
/* SL-142: на телефоне первая строка — слово, источник, число слов и галочка;
   вторая — победитель целиком, выровненный по левому краю. */
@media (max-width:760px){
  .history-word-summary{grid-template-columns:minmax(0,1fr) 20px;gap:10px;padding:14px 16px}
  .history-word-summary-left{grid-row:1;grid-column:1}
  .history-word-summary::after{grid-row:1;grid-column:2}
  .history-winner{grid-row:2;grid-column:1/-1;display:flex !important;align-items:baseline;flex-wrap:wrap;gap:4px 8px !important;text-align:left}
  .history-winner>span{font-size:11px}
  .history-winner>strong{display:inline;font-size:15px;text-align:left}
  .history-winner>small{font-size:13px;white-space:normal;text-align:left !important}
}

/* v24.1 — full continuous definitions in My Dictionary.
   Closed rows stay compact with an ellipsis; opened rows show the same full
   text continuously instead of stitching a truncated preview to a tail. */

/* v24.4 — learning page layout, expandable definitions and Green Glow progress */

.history-word-list .history-unique-word{
  font-weight:850!important;
}

.learning-page{
  --learning-green-glow:#B0C965;
  --learning-green-glow-soft:color-mix(in srgb, #B0C965 18%, var(--panel));
  padding-bottom:18px;
}
.learning-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin:18px 0 20px;
}
.learning-head h1{
  margin:1px 0 0;
  font-size:clamp(34px,5vw,52px);
  line-height:1;
  letter-spacing:-.045em;
}
.learning-head .eyebrow{margin:0 0 6px}
.learning-back{min-height:42px;padding:0 16px;white-space:nowrap}
.learning-insufficient{padding:22px}
.learning-insufficient h2{margin:0 0 10px;font-size:22px}
.learning-insufficient p{margin:0 0 12px;color:var(--muted)}
.learning-insufficient button{margin-top:4px}
.learning-select-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:5px;
}
.learning-help{margin:0 0 13px;font-size:13px}
.learning-word-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  max-height:56vh;
  overflow:auto;
  padding:2px 3px 8px 1px;
}
.learning-word-choice{
  position:relative;
  min-height:62px;
  padding:11px 10px 9px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--panel);
  color:var(--text);
  text-align:center;
  font:inherit;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:center;
  gap:9px;
}
.learning-word-label{
  display:block;
  text-align:center;
  font-size:19px;
  line-height:1.16;
  font-weight:760;
  overflow-wrap:anywhere;
}
.learning-word-progress{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:2px;
  width:100%;
  height:4px;
  margin-top:auto;
}
.learning-word-progress i{
  display:block;
  min-width:0;
  height:4px;
  border-radius:999px;
  background:color-mix(in srgb, var(--muted) 34%, transparent);
}
.learning-word-progress i.filled{
  background:var(--learning-green-glow);
  box-shadow:0 0 5px color-mix(in srgb, var(--learning-green-glow) 45%, transparent);
}
.learning-word-choice:hover{border-color:var(--accent);background:var(--accent-soft)}
.learning-word-choice.mastered{background:var(--learning-green-glow-soft)}
.learning-word-choice.selected{
  border-color:var(--accent);
  background:var(--accent-soft);
  box-shadow:inset 0 0 0 1px var(--accent);
}
.learning-word-choice.mastered.selected{
  background:color-mix(in srgb, var(--learning-green-glow) 24%, var(--panel));
}
.learning-status{height:auto;min-height:22px;margin:0;text-align:center;max-width:none}
.learning-progress-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:1px 2px 12px;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}
.learning-question-card{
  min-height:92px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:15px 20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--panel-2, var(--segmented-bg));
  text-align:center;
}
.learning-question-card.definition-question{
  min-height:112px;
  padding:15px 20px 12px;
}
.learning-prompt{
  max-width:760px;
  font-size:clamp(26px,4vw,38px);
  line-height:1.12;
  font-weight:820;
}
.learning-prompt.definition-prompt{
  width:100%;
  max-height:4.25em;
  overflow:hidden;
  font-size:clamp(16px,2.1vw,20px);
  font-weight:650;
  line-height:1.4;
}
.learning-prompt.definition-prompt.expanded{max-height:none;overflow:visible}
.learning-prompt-expand,
.learning-option-expand{
  border:0;
  background:transparent;
  color:var(--accent);
  padding:2px 4px;
  font-size:12px;
  font-weight:720;
  cursor:pointer;
}
.learning-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.learning-option{
  position:relative;
  min-height:76px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  line-height:1.32;
  text-align:left;
  cursor:pointer;
}
.learning-option.definition-option{
  height:112px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap:5px;
}
.learning-option.definition-option.expanded{height:auto;min-height:112px}
.learning-option-text{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:4;
  overflow:hidden;
}
.learning-option.definition-option.expanded .learning-option-text{
  display:block;
  overflow:visible;
}
.learning-option-expand{
  align-self:center;
  flex:0 0 auto;
  margin-top:auto;
}
.learning-option[data-key]{padding-left:38px}
.learning-option[data-key]::before{
  content:attr(data-key);
  position:absolute;
  top:10px;
  left:10px;
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border:1px solid var(--line);
  border-radius:6px;
  color:var(--muted);
  font-size:12px;
  font-weight:720;
  line-height:1;
}
.learning-option.word-option{text-align:center;font-weight:780;font-size:17px}
.learning-option.word-option[data-key]{padding-right:38px}
.learning-option:hover:not(:disabled){border-color:var(--accent);background:var(--accent-soft)}
.learning-option.wrong{border-color:var(--danger);opacity:.62}
.learning-option.correct{border-color:var(--accent);background:var(--accent-soft);font-weight:750}
.learning-input-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  margin-top:12px;
}
.learning-feedback-row{
  display:grid;
  grid-template-columns:116px minmax(0,1fr) 116px;
  align-items:center;
  min-height:46px;
  margin-top:8px;
}
.learning-feedback-spacer{grid-column:1}
.learning-feedback-row .learning-status{
  grid-column:2;
  justify-self:center;
  width:100%;
}
.learning-next{
  grid-column:3;
  justify-self:end;
  width:116px;
  min-width:116px;
  min-height:48px;
  padding:0 14px;
}
.learning-answer-revealed{font-weight:700}
.learning-complete{text-align:center;padding:30px 8px 14px}
.learning-complete h3{font-size:27px;margin:0 0 8px}
.learning-complete p{margin:0 0 20px;color:var(--muted)}
.learning-complete-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}

html[data-theme="dark"] .learning-page{
  --learning-green-glow-soft:color-mix(in srgb, #B0C965 17%, var(--panel));
}

@media(max-width:760px){
  .learning-head{align-items:stretch;flex-direction:column;gap:12px;margin-top:8px}
  .learning-back{align-self:flex-start}
  .learning-word-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:55vh}
  .learning-options{grid-template-columns:1fr}
  .learning-select-toolbar{align-items:stretch;flex-direction:column}
  .learning-feedback-row{grid-template-columns:92px minmax(0,1fr) 92px}
  .learning-next{width:92px;min-width:92px;padding:0 10px}
}
@media(max-width:430px){
  .learning-word-grid{grid-template-columns:1fr}
  .learning-input-form{grid-template-columns:1fr}
  .learning-input-form button{width:100%}
  .learning-feedback-row{grid-template-columns:74px minmax(0,1fr) 74px}
  .learning-next{width:74px;min-width:74px;padding:0 8px;font-size:13px}
}

/* v24.6 — learning polish and learned-words leaderboard */

.learning-head{align-items:flex-end}
.learning-input-form{
  grid-template-columns:minmax(0,1fr) 160px;
}
.learning-action-button{
  width:160px!important;
  min-width:160px!important;
  height:48px;
  min-height:48px!important;
  padding:0 14px!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.learning-feedback-row{
  grid-template-columns:160px minmax(0,1fr) 160px;
}
.learning-next{
  width:160px!important;
  min-width:160px!important;
  height:48px;
  min-height:48px!important;
  padding:0 14px!important;
}

@media(max-width:760px){
  .learning-head{align-items:flex-start}
  .learning-input-form{grid-template-columns:minmax(0,1fr) 132px}
  .learning-action-button,.learning-next{width:132px!important;min-width:132px!important}
  .learning-feedback-row{grid-template-columns:132px minmax(0,1fr) 132px}
}
@media(max-width:430px){
  .learning-input-form{grid-template-columns:1fr}
  .learning-action-button{width:100%!important;min-width:0!important}
  .learning-feedback-row{grid-template-columns:1fr}
  .learning-feedback-spacer{display:none}
  .learning-feedback-row .learning-status{grid-column:1;justify-self:center}
  .learning-next{grid-column:1;width:100%!important;min-width:0!important}
}

/* v24.7 — learning navigation, sorting and stable progress */
.learning-select-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.learning-sort-group{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}
.learning-word-sort{
  width:auto;
  min-width:170px;
  min-height:38px;
  padding-top:7px;
  padding-bottom:7px;
}
@media(max-width:760px){
  .learning-select-actions{width:100%;justify-content:flex-start}
  .learning-sort-group{flex:1 1 240px}
  .learning-word-sort{width:100%}
}
@media(max-width:520px){
  .learning-select-actions{display:grid;grid-template-columns:1fr;width:100%}
  .learning-sort-group{display:grid;grid-template-columns:auto minmax(0,1fr);width:100%}
  #learningRandomButton{width:100%}
}

/* v24.8 — pagination, learning filters and shared dictionaries */

.dictionary-study-progress{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:2px;
  width:100%;
  max-width:150px;
  height:3px;
}
.dictionary-study-progress i{
  height:3px;
  border-radius:999px;
  background:color-mix(in srgb,var(--muted) 30%,transparent);
}
.dictionary-study-progress i.filled{
  background:#B0C965;
  box-shadow:0 0 4px color-mix(in srgb,#B0C965 48%,transparent);
}

/* SL-101 — добавить слово из чужого словаря: справа от стрелки, на месте корзины своего. */

.word-pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  flex-wrap:wrap;
  padding:16px 14px 4px;
}
.word-page-button{
  min-width:34px;
  height:34px;
  padding:0 9px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  font-size:13px;
  font-weight:720;
  cursor:pointer;
}
.word-page-button:hover:not(:disabled):not(.active){border-color:var(--accent);background:var(--accent-soft)}
.word-page-button.active{background:var(--accent);border-color:var(--accent);color:white;cursor:default}
.word-page-button:disabled{opacity:.35;cursor:not-allowed}
.word-page-dots{padding:0 2px;color:var(--muted)}

.learning-filter-toolbar{
  display:grid;
  grid-template-columns:minmax(180px,1fr) auto auto auto;
  gap:10px;
  align-items:end;
  margin:10px 0 12px;
}
.learning-filter-toolbar .learning-sort-group{
  display:grid;
  gap:5px;
  align-items:stretch;
  white-space:normal;
}
.learning-filter-toolbar .personal-dictionary-sort,
.learning-word-search{
  width:100%;
  min-width:150px;
  min-height:38px;
}
.learning-search-group{min-width:180px}
.learning-word-grid{
  max-height:none!important;
  overflow:visible!important;
}
.learning-word-grid.list-view{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px 8px;
}
.learning-word-grid.list-view .learning-word-choice{
  min-height:38px;
  padding:6px 8px 6px;
  border-radius:9px;
  gap:5px;
}
.learning-word-grid.list-view .learning-word-label{
  font-size:14px;
  line-height:1.08;
  font-weight:720;
}
.learning-word-grid.list-view .learning-word-progress,
.learning-word-grid.list-view .learning-word-progress i{height:3px}

.dictionary-sharing-mode{margin-bottom:12px}
.dictionary-share-selected{margin-top:12px}
.dictionary-share-add{margin-bottom:8px}
.dictionary-share-list{display:grid;gap:6px}
.dictionary-share-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:40px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
}
.dictionary-share-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dictionary-share-empty{margin:7px 0 0}

@media(max-width:900px){
  .learning-filter-toolbar{grid-template-columns:1fr 1fr}
}
@media(max-width:760px){
  .learning-word-grid.list-view{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .learning-filter-toolbar{grid-template-columns:1fr}

  .learning-word-grid.list-view{grid-template-columns:1fr}
}

/* v24.10 — dictionary sharing picker and aligned dictionary selector */

.dictionary-sharing-mode{
  width:min(100%,680px);
  margin:0;
  align-self:start;
}
.dictionary-sharing-mode span{min-height:40px;padding:9px 12px}
.dictionary-share-selected{margin:0;width:min(100%,680px)}
.dictionary-share-picker{position:relative;width:100%}
.dictionary-share-picker-button{
  width:100%;
  min-height:46px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto 20px;
  align-items:center;
  gap:10px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  font-size:14px;
  font-weight:720;
  text-align:left;
  cursor:pointer;
}
.dictionary-share-picker-button:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
.dictionary-share-picker-button:focus-visible{outline:3px solid rgba(56,95,77,.18);outline-offset:1px}
.dictionary-share-picker-meta{color:var(--muted);font-size:12px;font-weight:650;white-space:nowrap}
.dictionary-share-picker-chevron{
  width:20px;height:20px;
  background:var(--muted);
  -webkit-mask:var(--chevron-mask);
  mask:var(--chevron-mask);
  justify-self:center;
  transition:transform .15s ease;
}
.dictionary-share-picker-button[aria-expanded="true"] .dictionary-share-picker-chevron{transform:rotate(180deg)}
.dictionary-share-picker-panel{
  position:absolute;
  z-index:30;
  left:0;right:0;
  top:calc(100% + 6px);
  max-height:280px;
  overflow:auto;
  padding:6px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  box-shadow:0 14px 30px rgba(34,31,26,.14);
}
.dictionary-share-picker-list{display:grid;gap:2px}
.dictionary-share-candidate{
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:7px 9px;
  border-radius:9px;
  cursor:pointer;
  font-size:14px;
}
.dictionary-share-candidate:hover{background:var(--segmented-bg)}
.dictionary-share-candidate span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dictionary-share-candidate input{
  appearance:none;
  width:19px;height:19px;
  flex:0 0 19px;
  margin:0;
  border:1.5px solid var(--line-strong,var(--line));
  border-radius:5px;
  background:var(--panel);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.dictionary-share-candidate input:checked{background:var(--accent);border-color:var(--accent)}
.dictionary-share-candidate input:checked::after{
  content:"";
  width:8px;height:4px;
  border-left:2px solid #fff;
  border-bottom:2px solid #fff;
  transform:rotate(-45deg) translateY(-1px);
}
.dictionary-share-candidate input:disabled{opacity:.55;cursor:wait}
.dictionary-share-empty{margin:6px 8px!important;font-size:13px}
#dictionaryShareStatus{margin:0;min-height:18px}

@media(max-width:760px){
  .dictionary-sharing-mode,.dictionary-share-selected{width:100%}
}

/* v24.11 — dictionary sharing search, explicit save and non-clipped picker */

.dictionary-share-picker-panel{
  position:relative;
  z-index:1;
  left:auto;
  right:auto;
  top:auto;
  margin-top:8px;
  max-height:none;
  overflow:visible;
  padding:8px;
}
.dictionary-share-picker-search{margin-bottom:7px}
.dictionary-share-picker-search input{
  width:100%;
  height:42px;
  min-height:42px;
  padding:0 13px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  font-size:14px;
  outline:none;
}
.dictionary-share-picker-search input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(56,95,77,.12);
}
.dictionary-share-picker-list{
  max-height:260px;
  overflow:auto;
  overscroll-behavior:contain;
  padding-right:2px;
}
.dictionary-sharing-actions{
  width:min(100%,680px);
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
.dictionary-share-save{
  min-width:140px;
  min-height:42px;
  padding:0 22px;
  border-radius:12px;
}
.dictionary-share-save:disabled{opacity:.45;cursor:default;filter:none}
@media(max-width:760px){
  .dictionary-sharing-actions{width:100%}
  .dictionary-share-save{width:100%}
}

/* v24.12 — unified account settings layout */

#accountAdminTools.profile-card{padding:22px 24px}
.personal-dictionary-problems{margin:0 16px 12px;color:var(--danger);font-size:13px;line-height:1.45;white-space:pre-line}

/* «Мои предложения» (SL-52) */

.my-suggestions-list{padding:0 18px}
.my-suggestion{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line)}
.my-suggestion:last-child{border-bottom:0}
.my-suggestion-main{min-width:0}
.my-suggestion-title{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-weight:780}
.my-suggestion-definition{margin:3px 0 0;color:var(--muted);font-size:14px;line-height:1.45}
.my-suggestion-dates{margin:3px 0 0;color:var(--muted);font-size:12px}
.suggestion-status{padding:1px 8px;border-radius:999px;border:1px solid var(--line);color:var(--muted);font-size:11px;font-weight:600}
.suggestion-status.approved{color:var(--success);border-color:currentColor}
.suggestion-status.rejected{color:var(--danger);border-color:currentColor}
.suggestion-kind{padding:1px 8px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:700}
@media(max-width:760px){
  .my-suggestion{grid-template-columns:1fr}
  .my-suggestion .dictionary-search-add{width:100%}
}

/* SL-77 — рейтинг игроков */
.ranking-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:18px;align-items:start}
.ranking-categories{display:grid;gap:12px}
.ranking-category{display:flex;align-items:baseline;justify-content:space-between;gap:12px;width:100%;padding:18px 20px;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text);text-align:left;font:inherit}
.ranking-category:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
.ranking-category.active{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.ranking-category-name{font-size:17px;font-weight:780}
.ranking-category-place{color:var(--accent);font-size:13px;font-weight:780;white-space:nowrap}
.ranking-panel{padding:20px;box-shadow:none}
.ranking-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.ranking-description{margin:0;color:var(--muted);font-size:14px;line-height:1.45}
.ranking-period{display:flex;flex:none;gap:4px;padding:4px;border-radius:14px;background:var(--segmented-bg)}
.ranking-period button{border:0;background:transparent;color:var(--muted);padding:8px 14px;border-radius:10px;font:inherit;font-size:14px;font-weight:700;white-space:nowrap}
.ranking-period button.active{background:var(--panel);color:var(--text);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.ranking-list{display:grid;gap:8px}
.ranking-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:14px;align-items:center;min-height:60px;padding:10px 18px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.ranking-row.rank-1{background:var(--rank-1-bg);border-color:var(--rank-1-line)}
.ranking-row.rank-2{background:var(--rank-2-bg);border-color:var(--rank-2-line)}
.ranking-row.own{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.ranking-place{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:15px;font-weight:800}
.ranking-row.rank-1 .ranking-place{background:var(--accent);color:var(--panel)}
.ranking-nickname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px}
.ranking-value{white-space:nowrap;text-align:right}
.ranking-value strong{font-size:18px;font-weight:800}
.ranking-row.with-access{grid-template-columns:36px minmax(0,1fr) auto auto}
.ranking-dictionary-access{min-height:36px;padding:0 12px;border-radius:10px;font-size:13px;white-space:nowrap;cursor:pointer}
.ranking-dictionary-access:disabled{opacity:.4;cursor:not-allowed}
.ranking-empty{padding:18px 4px;color:var(--muted)}
.ranking-status{margin:12px 0 0}
@media(max-width:700px){
  .ranking-layout{grid-template-columns:1fr;gap:12px}
  .ranking-categories{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .ranking-category{flex-direction:column;align-items:flex-start;gap:3px;padding:10px 11px;border-radius:14px}
  .ranking-category-name{font-size:13px;line-height:1.2}
  .ranking-category-place{font-size:11px}
  .ranking-panel{padding:14px}
  .ranking-panel-head{flex-direction:column;gap:10px}
  .ranking-row{grid-template-columns:30px minmax(0,1fr) auto;gap:10px;min-height:52px;padding:8px 12px}
  .ranking-row.with-access{grid-template-columns:30px minmax(0,1fr) auto auto}
  .ranking-dictionary-access{min-height:34px;padding:0 8px;font-size:12px}
  .ranking-place{width:30px;height:30px;font-size:13px}
  .ranking-nickname{font-size:15px}
  .ranking-value strong{font-size:16px}
}
/* Пять пунктов меню в одну строку на телефоне: перенос сдвигает игровой экран вниз. */
@media(max-width:430px){
  .top-actions{gap:0;flex-wrap:nowrap}
  .top-actions .nav-button{font-size:3.1vw;padding:8px 1.2vw;letter-spacing:-.01em}
  .top-actions .account-avatar-button{width:34px;height:34px}
}
@media(max-width:340px){
  .top-actions{flex-wrap:wrap}
  .top-actions .nav-button{font-size:11px}
}

/* SL-73, SL-75 — ник для входа и пароль */
.field-hint{margin:6px 0 0;font-size:13px;line-height:1.45;color:var(--muted)}

/* SL-108: календарь слов в админке */
.admin-calendar-list{display:grid;gap:14px;margin-top:10px}
.admin-calendar-day{display:grid}
.admin-calendar-date{margin:0;font-size:14px;color:var(--muted)}
.admin-calendar-note{margin-top:0;font-size:14px}
.admin-calendar-warning{font-size:12px;line-height:1.35;color:var(--danger)}
.admin-calendar-editor{display:grid;gap:8px;padding:0 0 12px}
.admin-calendar-preview{margin:0;font-size:12px;line-height:1.35}
.admin-calendar-definition{resize:vertical;min-height:72px;font:inherit}
#adminCalendarMoreButton{margin-top:14px}
.admin-calendar-row .admin-dictionary-word{flex:1 1 auto}
@media (max-width:620px){.admin-calendar-row .admin-dictionary-actions{width:auto;flex-direction:column}}
/* SL-120: ответы слова календаря, частотные выделены */
.admin-calendar-answers{font-size:12px;line-height:1.45}
.admin-calendar-answers summary{cursor:pointer;color:var(--muted);width:max-content}
.admin-calendar-answers p{margin:4px 0 0;color:var(--muted)}
.admin-calendar-answers-length{color:var(--text)}
.admin-calendar-answer-common{color:var(--text);font-weight:650}

/* Страница аккаунта: шапка профиля, строки настроек, плитки администрирования (SL-139) */
.account-page{display:grid;gap:14px}
.account-hero{display:flex;align-items:center;gap:24px;padding:30px 28px}
.account-hero-text{min-width:0}
.account-hero-text h2{margin:0;font-size:30px;line-height:1.15;letter-spacing:-.03em;overflow-wrap:anywhere}
.account-hero-login{margin:6px 0 0;color:var(--muted);font-size:15px}
.account-hero-text .text-button{margin:6px 0 0 -8px}
.account-hero-text .profile-feedback:empty{display:none}
.account-avatar{position:relative;flex:none;width:112px;height:112px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer}
.account-avatar-circle{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:50%;overflow:hidden;background:var(--accent-soft);border:1px solid var(--line);color:var(--accent);font-size:46px;font-weight:800}
.account-avatar-circle img{width:100%;height:100%;object-fit:cover}
.account-avatar svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.account-avatar-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:50%;background:rgba(20,24,20,.38);color:#fff;opacity:0;transition:opacity .15s ease}
.account-avatar-overlay svg{width:34px;height:34px}
.account-avatar:hover .account-avatar-overlay,.account-avatar:focus-visible .account-avatar-overlay{opacity:1}
.account-avatar:not(.has-photo):hover #avatarInitial,.account-avatar:not(.has-photo):focus-visible #avatarInitial{visibility:hidden}
.account-avatar-badge{position:absolute;right:2px;bottom:2px;display:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--panel);border:1px solid var(--line);color:var(--accent);box-shadow:0 1px 4px rgba(0,0,0,.12)}
.account-avatar-badge svg{width:17px;height:17px}
@media (hover:none){
  .account-avatar-badge{display:flex}
  .account-avatar:hover .account-avatar-overlay{opacity:0}
  .account-avatar:not(.has-photo):hover #avatarInitial{visibility:visible}
}
.account-group-label{margin:10px 4px -6px;color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.account-list{padding:0;overflow:visible}
.account-row{padding:16px 20px;border-top:1px solid var(--line)}
.account-row:first-child{border-top:0}
.account-row-main{display:flex;align-items:center;gap:16px;min-height:30px}
.account-row-title{flex:none;width:180px;font-size:15px;font-weight:650}
.account-row-value{flex:1;min-width:0;color:var(--muted);font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-row-value.empty{font-style:italic}
.account-row-toggle,.account-danger-link{flex:none;border:0;background:none;padding:4px 0;color:var(--accent);font-size:14px;font-weight:650}
.account-row-toggle[aria-expanded="true"]{color:var(--muted)}
.account-danger-link{color:var(--danger)}
.account-row-control{flex:1;max-width:420px;margin-left:auto}
.account-row-control span{padding:8px 12px;font-size:13px}
.account-row-edit{display:grid;gap:10px;max-width:424px;margin:14px 0 4px 196px}
.account-row-edit .field-input{width:100%}
.account-row-edit .field-hint{margin:0}
.account-row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;margin-top:4px}
.account-row .profile-feedback:empty{display:none}
.account-row > .profile-feedback{margin:8px 0 0 196px}
.account-row .dictionary-share-selected,.account-row .dictionary-sharing-actions{width:auto;max-width:420px;margin:12px 0 0 auto}
.account-row .dictionary-sharing-actions{justify-content:flex-end}
.account-admin{display:grid;gap:14px}
.account-admin-card{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:22px 24px}
.account-tile{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);font-size:14px;font-weight:650;line-height:1.3;text-align:left}
.account-tile:hover{background:var(--accent-soft)}
.account-tile-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:11px;background:var(--accent-soft);color:var(--accent)}
.account-tile-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.account-logout{justify-self:center;border:0;background:none;padding:14px;color:var(--danger);font-size:15px;font-weight:700}
@media(max-width:700px){
  .account-hero{gap:18px;padding:24px 20px}
  .account-avatar{width:92px;height:92px}
  .account-avatar-circle{font-size:38px}
  .account-hero-text h2{font-size:26px}
  .account-row{padding:14px 16px}
  .account-row-main{flex-wrap:wrap;gap:6px 12px}
  .account-row-title{flex:1;width:auto}
  .account-row-value{order:3;flex-basis:100%}
  .account-row-control{order:4;flex-basis:100%;max-width:none}
  .account-row-edit{max-width:none;margin-left:0}
  .account-row > .profile-feedback{margin-left:0}
  .account-row .dictionary-share-selected,.account-row .dictionary-sharing-actions{max-width:none;margin-left:0}
  .account-admin-card{grid-template-columns:1fr 1fr;padding:18px}
}

/* SL-141 — страница «Мой словарь» */
.dictionary-page svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dictionary-page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0 18px}
.dictionary-page-head h1{margin:0;min-width:0;font-size:clamp(27px,3.4vw,36px);line-height:1.08;letter-spacing:-.035em;overflow-wrap:anywhere}
.dictionary-picker{flex:none;display:flex;align-items:center;gap:8px}
.dictionary-picker-label{color:var(--muted);font-size:13px;font-weight:650;white-space:nowrap}
.dictionary-picker-pill{position:relative;display:inline-flex;align-items:center;gap:6px;max-width:200px;height:38px;padding:0 12px 0 14px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--text);font-size:14px;font-weight:650}
.dictionary-picker-pill:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.dictionary-picker-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dictionary-picker-pill svg{flex:none;width:20px;height:20px;stroke-width:2.2}
/* Нативный список поверх плашки: прозрачный, но получает нажатия и клавиатуру. */
.dictionary-picker-select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}
.dictionary-picker{position:relative}
.dictionary-picker-button{display:none;position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;border-radius:inherit;background:transparent;cursor:pointer}
.dictionary-picker-button:focus-visible{outline:none}
.dictionary-picker.custom-menu .dictionary-picker-button{display:block}
.dictionary-picker.custom-menu .dictionary-picker-select{pointer-events:none}
.dictionary-menu{position:absolute;z-index:30;top:calc(100% + 8px);right:0;min-width:260px;max-width:min(360px,calc(100vw - 32px));max-height:min(420px,70vh);overflow-y:auto;padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 40px rgba(40,36,31,.18);outline:none}
html[data-theme="dark"] .dictionary-menu{box-shadow:0 14px 40px rgba(0,0,0,.45)}
.dictionary-menu-group{border-top:1px solid var(--line);margin-top:6px;padding-top:4px}
.dictionary-menu-label{padding:8px 12px 4px;color:var(--muted);font-size:11.5px;font-weight:750;letter-spacing:.08em;text-transform:uppercase}
.dictionary-menu-item{padding:9px 12px;border-radius:9px;color:var(--text);font-size:14.5px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.dictionary-menu-item.active{background:color-mix(in srgb,var(--accent-soft) 60%,transparent)}
.dictionary-menu-item[aria-selected="true"]{background:var(--accent-soft);color:var(--accent)}

.dictionary-toolbar{display:flex;gap:10px;align-items:center}
.dictionary-search{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:52px;padding:0 16px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--muted);box-shadow:var(--shadow)}
.dictionary-search:focus-within{border-color:var(--accent)}
.dictionary-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:inherit;font-size:16px;color:var(--text)}
.dictionary-search input::placeholder{color:var(--muted);text-overflow:ellipsis}
.dictionary-search input::-webkit-search-cancel-button{cursor:pointer}
.dictionary-learn{flex:none;height:52px;padding:0 24px;border:0;border-radius:14px;background:#B0C965;color:#202815;font-weight:760;font-size:15px;box-shadow:0 4px 12px color-mix(in srgb,#B0C965 24%,transparent);cursor:pointer}
.dictionary-learn:hover{background:#a3bd55}
.dictionary-icon-button{flex:none;display:grid;place-items:center;width:52px;height:52px;padding:0;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);cursor:pointer}
.dictionary-icon-button:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
.dictionary-icon-button:disabled{opacity:.5;cursor:progress}

.dictionary-suggestions{margin-top:16px;border-radius:14px;background:var(--accent-soft)}
.dictionary-suggestions-head{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;font-size:14px;font-weight:700;cursor:pointer}
.dictionary-suggestions-head::-webkit-details-marker{display:none}
.dictionary-suggestions-meta{display:inline-flex;align-items:center;gap:4px;color:var(--muted);font-weight:600;text-align:right}
.dictionary-suggestions-meta svg{flex:none;width:20px;height:20px;stroke-width:2.2;transition:transform .15s ease}
.dictionary-suggestions[open] .dictionary-suggestions-meta svg{transform:rotate(90deg)}
.dictionary-suggestions .my-suggestions-list{margin:0 8px 8px;padding:2px 14px;border-radius:12px;background:var(--panel)}

.dictionary-page .personal-dictionary-problems{margin:12px 0 0}
.dictionary-filters{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:16px 0 12px;scroll-margin-top:12px}
.dictionary-chips{display:flex;gap:8px;min-width:0;overflow-x:auto;scrollbar-width:none}
.dictionary-chips::-webkit-scrollbar{display:none}
.dictionary-chip{flex:none;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--text);padding:8px 14px;font-weight:650;font-size:14px;cursor:pointer}
.dictionary-chip b{margin-left:4px;color:var(--muted);font-weight:650}
.dictionary-chip:hover{border-color:var(--accent)}
.dictionary-chip[aria-pressed="true"]{background:var(--accent-soft);border-color:transparent;color:var(--accent)}
.dictionary-chip[aria-pressed="true"] b{color:var(--accent);opacity:.75}
.dictionary-added-count{margin:0;color:var(--muted);font-size:14px;font-weight:600}
.dictionary-sort{position:relative;flex:none;display:inline-flex;align-items:center;gap:6px;padding:8px 4px;color:var(--muted);font-weight:650;font-size:14px;cursor:pointer}
.dictionary-sort svg{width:17px;height:17px}
.dictionary-sort:hover{color:var(--text)}
.dictionary-sort select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}
.dictionary-sort.custom-menu .dictionary-picker-button{display:block;border-radius:8px}
.dictionary-sort.custom-menu .dictionary-picker-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.dictionary-sort.custom-menu select{pointer-events:none}
.dictionary-sort.custom-menu:has(.dictionary-picker-button[aria-expanded="true"]){color:var(--text)}
.dictionary-sort-menu{min-width:200px;cursor:default}

.dictionary-word-list{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.dictionary-word-list .personal-dictionary-empty{grid-column:1/-1;padding:18px;color:var(--muted);font-size:14px}
.personal-word-item{border-bottom:1px solid var(--line)}
.personal-word-item:last-child{border-bottom:0}
.personal-word-item[open]{background:color-mix(in srgb,var(--accent-soft) 45%,var(--panel))}
.personal-word-summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;padding:10px 12px 14px 18px;cursor:pointer}
.personal-word-summary::-webkit-details-marker{display:none}
.personal-word-head{display:flex;align-items:center;gap:10px;min-width:0}
.personal-word-title{font-size:17px;font-weight:760;letter-spacing:-.01em;overflow-wrap:anywhere}
.personal-word-meta{color:var(--muted);font-size:12.5px;font-weight:600;white-space:nowrap}
.personal-word-head .dictionary-study-progress{display:inline-flex;gap:3px;align-items:center;flex:none}
.personal-word-head .dictionary-study-progress i{width:7px;height:7px;border-radius:50%;background:var(--line)}
.personal-word-head .dictionary-study-progress i.filled{background:#B0C965}
.personal-word-controls{display:inline-flex;align-items:center}
.personal-word-chevron,.personal-word-delete,.personal-word-add{display:grid;place-items:center;width:28px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--muted)}
.personal-word-chevron svg{width:20px;height:20px;stroke-width:2.2;transition:transform .15s ease}
.personal-word-item[open] .personal-word-chevron svg{transform:rotate(180deg)}
.personal-word-delete,.personal-word-add{cursor:pointer}
.personal-word-delete svg,.personal-word-add svg{width:17px;height:17px}
.personal-word-delete{opacity:.75}
.personal-word-delete:hover{opacity:1;color:var(--danger);background:color-mix(in srgb,var(--danger) 9%,transparent)}
.personal-word-add{color:var(--accent)}
.personal-word-add:hover:not(:disabled){background:var(--accent-soft)}
.personal-word-add.saved{cursor:default;opacity:.7}
.personal-word-preview{grid-column:1/-1;margin:3px 60px 0 0;color:var(--muted);font-size:14.5px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.personal-word-item[open] .personal-word-preview{display:none}
.personal-word-body{padding:0 18px 14px}
.personal-word-definition{font-size:14.5px;line-height:1.5;color:var(--text);overflow:visible}
.personal-word-definition .definition-senses{padding-left:1.6em}
.personal-word-sources{margin:10px 0 0;color:var(--muted);font-size:12px}
.personal-word-sources:empty{display:none}
@media (min-width:900px){
  .dictionary-word-list{display:grid;grid-template-columns:1fr 1fr}
  .personal-word-item:nth-child(odd){border-right:1px solid var(--line)}
  .personal-word-item:nth-last-child(2):nth-child(odd){border-bottom:0}
}

.dictionary-page #personalDictionaryPagination{margin:18px 0 6px}
.dictionary-search-section{margin-top:22px}
.dictionary-search-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.dictionary-search-section-head h2{margin:0;font-size:16px;letter-spacing:0}
.dictionary-search-section .dictionary-search-status{min-height:0;margin:0}

@media (max-width:680px){
  .dictionary-page-head{flex-wrap:wrap;gap:12px}
  .dictionary-picker-pill{max-width:190px}
  .dictionary-toolbar{flex-wrap:wrap}
  .dictionary-toolbar:has(.dictionary-learn:not(.hidden)) .dictionary-search{flex-basis:100%}
  .dictionary-learn{flex:1}
  .dictionary-suggestions-head{flex-direction:column;align-items:flex-start;gap:2px}
  .dictionary-suggestions-meta{text-align:left}
  .dictionary-filters{margin-right:-11px}
  .dictionary-sort{padding-right:16px}
  .dictionary-chips:not(.hidden) + .dictionary-added-count + .dictionary-sort span{display:none}
  .dictionary-added-count{font-size:13px}
  .personal-word-summary{padding:10px 10px 14px 16px}
  .personal-word-preview{margin-right:0}
  .personal-word-body{padding:0 16px 14px}
}

/* SL-147 — счётчик новых слов, плашка на главной и общий список «Новые слова» */
.admin-words-count{min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:var(--danger);color:#fff;font-size:11px;font-weight:800;line-height:19px;text-align:center}
.admin-words-count.avatar{position:absolute;top:-4px;right:-5px;z-index:1;line-height:15px;border:2px solid var(--bg);pointer-events:none}
.account-menu button .admin-words-count{margin-left:auto}
.admin-words-banner{display:flex;align-items:center;gap:14px;margin:0 0 18px;padding:14px 18px;border:1px solid var(--line);border-radius:16px;background:var(--accent-soft)}
.admin-words-banner-icon{flex:none;width:40px;height:40px;border-radius:11px;background:var(--panel);color:var(--accent);display:flex;align-items:center;justify-content:center}
.admin-words-banner-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.admin-words-banner p{flex:1;margin:0;font-size:15px;line-height:1.4}
.admin-words-banner small{display:block;color:var(--muted);font-size:13px}
.admin-words-banner .primary{min-height:42px;padding:0 18px}
/* Вся плашка нажимается: невидимый слой кнопки растянут на неё, в фокусе по-прежнему одна кнопка. */
.admin-words-banner{position:relative;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}
.admin-words-banner .primary::after{content:"";position:absolute;inset:0;border-radius:16px}
.admin-words-banner:hover{border-color:rgba(56,95,77,.32);background:color-mix(in srgb,var(--accent-soft),var(--accent) 10%)}
.admin-words-banner:hover .primary{background:var(--accent-hover)}
html[data-theme="dark"] .admin-entry-kind.suggestion{background:#3d3220;color:#e6c88f}
html[data-theme="dark"] .admin-entry-kind.restore{background:#432622;color:#eaa597}
html[data-theme="dark"] .admin-entry-kind.sense{background:#1f3347;color:#9cc4ea}
html[data-theme="dark"] .admin-sense-list li.admin-sense-new{background:#3d3220;box-shadow:inset 3px 0 0 #c99a2e}
html[data-theme="dark"] .admin-sense-tag{background:#6b5320;color:#f3dfa8}
@media(max-width:700px){
  .admin-words-banner{flex-wrap:wrap}
  .admin-words-banner .primary{width:100%}
}

.admin-entry-kind{padding:2px 8px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:11.5px;font-weight:700;letter-spacing:0}
.admin-entry-kind.suggestion{background:#f3e3c4;color:#7a5512}
.admin-entry-kind.restore{background:#f5ddd6;color:#8a3324}
.admin-entry-kind.sense{background:#dbe8f4;color:#1f4f7a}
/* SL-174: карточка нового значения — текущие значения и подсвеченное новое. */
.admin-sense-list{grid-column:1/-1;margin:2px 0 0;padding-left:22px;display:grid;gap:4px;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.admin-sense-list li.admin-sense-new{margin-left:-8px;padding:5px 8px;border-radius:8px;background:#fff1c2;box-shadow:inset 3px 0 0 #d9a520}
.admin-sense-list li.admin-sense-new::marker{font-weight:700}
.admin-sense-tag{margin-left:6px;padding:1px 7px;border-radius:999px;background:#f0d27a;color:#5a3f00;font-size:11px;font-weight:700;white-space:nowrap}
.admin-sense-hint{margin:0;font-size:12.5px}
.admin-removal-note{display:grid;gap:2px;margin:6px 0 0;padding:8px 10px;border-left:3px solid var(--danger);border-radius:0 8px 8px 0;background:var(--accent-soft);font-size:13px;line-height:1.45}
.admin-removal-note span{color:var(--muted);overflow-wrap:anywhere}

/* SL-149 — уведомления игрока в меню аватара */
.account-menu.notifications-open{width:370px;max-width:calc(100vw - 24px)}
.account-menu:focus{outline:none}
/* Смена панели: меню плавно меняет ширину, содержимое проявляется. */
.account-menu-main,.account-menu-notifications{animation:account-menu-panel .18s ease}
@keyframes account-menu-panel{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.account-menu-main,.account-menu-notifications{animation:none}}
.notifications-head{display:flex;align-items:center;gap:6px;padding:2px 4px 6px;margin-bottom:4px;border-bottom:1px solid var(--line)}
.notifications-head strong{font-size:15px;font-weight:750}
.account-menu .notifications-back{flex:none;width:32px;height:32px;padding:0;justify-content:center;border-radius:8px}
.account-menu .notifications-back .menu-icon{width:20px;height:20px;stroke:var(--text);stroke-width:2.2}
.notifications-list{display:grid;max-height:min(440px,62vh);overflow:auto}
.notifications-group{margin:6px 10px 2px;color:var(--muted);font-size:11.5px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.account-menu .notification-item{gap:11px;align-items:flex-start;padding:10px;border-radius:10px;font-weight:inherit;cursor:pointer}
.account-menu .notification-item:focus-visible{background:var(--accent-soft)}
.account-menu .notification-item.unseen{background:color-mix(in srgb,var(--accent-soft) 55%,transparent)}
.account-menu .notification-item.unseen:hover{background:var(--accent-soft)}
.notification-icon{flex:none;width:32px;height:32px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:var(--accent-soft);color:var(--accent)}
.notification-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.notification-icon.approved{background:#dcebe0;color:#2f6a46}
.notification-icon.rejected{background:#f3dcd8;color:#8c3b2c}
.notification-icon.share{background:#f3e3c4;color:#7a5512}
.notification-text{display:grid;gap:2px;min-width:0;font-size:14px;line-height:1.35}
.notification-text strong{font-weight:750}
.notification-text small{color:var(--muted);font-size:12px;font-weight:450}
.notifications-empty{margin:0;padding:10px;color:var(--muted);font-size:14px}
html[data-theme="dark"] .notification-icon.approved{background:#24402f;color:#9fd3b0}
html[data-theme="dark"] .notification-icon.rejected{background:#45271f;color:#e8a898}
html[data-theme="dark"] .notification-icon.share{background:#3d3220;color:#e6c88f}
@media(max-width:760px){
  .account-menu.notifications-open{width:auto;left:12px;right:12px}
}

/* SL-149 — переключатели уведомлений в аккаунте */
.notification-setting{display:flex;align-items:center;gap:16px}
.notification-setting-text{display:grid;gap:2px;flex:1;min-width:0}
.notification-setting-text .account-row-title{width:auto}
.notification-setting-hint{color:var(--muted);font-size:13px;line-height:1.35}
.switch{position:relative;flex:none;width:44px;height:26px;padding:0;border:0;border-radius:999px;background:var(--line);cursor:pointer;transition:background .15s ease}
.switch::after{content:'';position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:left .15s ease}
.switch[aria-checked="true"]{background:var(--accent)}
.switch[aria-checked="true"]::after{left:21px}
.switch:disabled{opacity:.6;cursor:default}
.switch:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#accountNotificationsSection > .profile-feedback{margin:0 20px 14px}
#accountNotificationsSection > .profile-feedback:empty{display:none}

/* SL-157: ожидание решения прямо в кнопке строки. */
.admin-entry button[aria-busy="true"]{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.admin-entry button[aria-busy="true"]::before{content:"";width:13px;height:13px;flex:none;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .8s linear infinite}
@media(prefers-reduced-motion:reduce){.admin-entry button[aria-busy="true"]::before{animation:none}}

/* SL-155: редактор остаётся в пределах видимой области над клавиатурой. */
.definition-popover.transitioning { overflow:hidden; }
.definition-editor-form { display:flex; flex-direction:column; gap:8px; min-height:0; overflow-y:auto; overscroll-behavior:contain; font-size:14px; }
.definition-editor-form label { color:var(--accent); }
.definition-editor-form textarea { min-height:70px; height:150px; flex-shrink:1; padding:10px 12px; line-height:1.5; resize:vertical; }
.definition-editor-form p { margin:0; font-size:12px; line-height:1.4; }
.definition-editor-buttons { display:flex; gap:10px; position:sticky; bottom:0; background:var(--panel); padding-top:6px; }
.definition-editor-buttons button { flex:1; min-height:42px; }
/* SL-174: форма нового значения под текущими значениями. */
.definition-suggest-form { margin-top:10px; }
.definition-suggest-form textarea { height:84px; }
.definition-suggest-sent { margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.4; }
/* SL-186: слово без определения — подпись и ссылка «Предложить своё» под ней. */
.definition-empty { margin:0; color:var(--muted); }
.definition-suggest-link { display:inline-flex; align-items:center; gap:6px; margin:8px 0 0; padding:4px 0; border:0; background:none; color:var(--accent); font:inherit; font-size:14px; font-weight:650; cursor:pointer; }
.definition-suggest-link:hover { text-decoration:underline; }
.definition-suggest-link svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; }

/* SL-160 — «Общий словарь»: поиск, свёрнутая форма добавления, компактные строки с иконками */
.admin-dictionary-total{margin:8px 0 0;font-size:14px}
.admin-dictionary-toolbar{display:flex;gap:10px;align-items:stretch;margin-bottom:12px}
.admin-dictionary-search{position:relative;flex:1;min-width:0}
.admin-dictionary-search svg{position:absolute;left:16px;top:50%;width:18px;height:18px;transform:translateY(-50%);fill:none;stroke:var(--muted);stroke-width:1.9;stroke-linecap:round;pointer-events:none}
.admin-dictionary-search .field-input{height:52px;padding-left:46px}
.admin-dictionary-add-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:52px;white-space:nowrap}
.admin-dictionary-add-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.admin-dictionary-add{display:grid;gap:6px;margin-bottom:12px;padding:18px 20px}
.admin-dictionary-add .field-label:first-child{margin-top:0}
.admin-dictionary-add .field-input + .field-label{margin-top:8px}
.admin-dictionary-add-buttons{display:flex;gap:10px;margin-top:10px}
.admin-dictionary-add-buttons button{min-height:44px}
.admin-dictionary-add .feedback:empty{display:none}
.admin-dictionary-status{margin:0 2px 10px;font-size:13px}
.admin-dictionary-results,.admin-dictionary-deleted{margin-bottom:14px;padding:0;overflow:hidden}

/* Строка админских списков и редактор определения: «Новые слова» и «Общий словарь» */
.admin-entries{padding:0;overflow:hidden}
.admin-entries > * + *{border-top:1px solid var(--line)}
.admin-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 14px;align-items:center;padding:13px 18px}
.admin-entry.open{align-items:start;background:color-mix(in srgb,var(--accent-soft) 45%,transparent)}
.admin-entry-info{min-width:0}
.admin-entry-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.admin-entry-word{font-size:15px;font-weight:750;letter-spacing:.02em;overflow-wrap:anywhere}
.admin-entry-meta{margin:2px 0 0;font-size:12.5px}
.admin-entry-note{margin:4px 0 0;font-size:12.5px;line-height:1.45}
.admin-entry-definition{margin:4px 0 0;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.admin-entry-definition.clamp{margin-top:3px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.admin-entry-definition.empty{color:var(--muted);font-style:italic}
.admin-entry-actions{display:flex;gap:8px;align-items:center}
.admin-copy{display:flex;align-items:center;gap:12px;margin-bottom:12px;padding:16px 18px}
.admin-copy-text{flex:1;min-width:0;margin:0;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);font-size:15px;line-height:1.55;overflow-wrap:anywhere;user-select:all}
.admin-copy-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 22px;font-size:16px;white-space:nowrap}
/* «Скопировано» — как «В моём словаре»: прозрачная кнопка с приглушённым текстом. */
.admin-copy-button.done{background:transparent;color:var(--muted);box-shadow:inset 0 0 0 1px var(--line)}
.admin-copy-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.admin-suggestion-list{display:grid;gap:12px}
.admin-suggestion{grid-template-columns:minmax(0,1fr);padding:16px 18px}
.admin-entry-actions .primary,.admin-entry-actions .secondary{min-height:36px;padding:0 13px;font-size:14px}
/* У .secondary нет общей подсветки; на админских страницах её дают все вторичные кнопки. */
.admin-entry-actions .secondary:hover:not(:disabled),.admin-editor-buttons .secondary:hover:not(:disabled),.admin-dictionary-add-buttons .secondary:hover:not(:disabled){border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.admin-icon{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text)}
.admin-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.admin-icon:hover:not(:disabled),.admin-icon[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
.admin-icon.danger{color:var(--danger)}
.admin-icon.danger:hover{border-color:var(--danger);color:var(--danger);background:color-mix(in srgb,var(--danger) 8%,var(--panel))}
.admin-icon:disabled{opacity:.5;cursor:progress}
.admin-editor{grid-column:1/-1;display:grid;gap:8px;min-width:0}
textarea.admin-editor-input{min-height:150px;padding:10px 12px;line-height:1.45;font-size:15px}
.admin-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.admin-editor-status{font-size:12.5px;line-height:1.35}
.admin-editor-buttons{display:flex;gap:8px;margin-left:auto}
.admin-editor-buttons button{min-height:38px;padding:0 15px;font-size:14px}
.admin-dictionary-missing-button{display:flex;align-items:center;gap:12px;width:100%;padding:13px 18px;border:0;border-radius:0;background:color-mix(in srgb,var(--accent-soft) 55%,transparent);color:var(--accent);font-size:15px;font-weight:650;text-align:left}
.admin-dictionary-missing-button:hover{background:var(--accent-soft)}
.admin-dictionary-missing-icon{flex:none;display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:9px;background:var(--panel)}
.admin-dictionary-missing-icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.admin-dictionary-more{display:block;width:100%;padding:14px;border-top:1px solid var(--line);border-radius:0}
.admin-dictionary-more:hover{background:var(--accent-soft)}
.admin-dictionary-deleted summary:hover{color:var(--accent)}
.admin-dictionary-deleted summary{display:flex;align-items:center;gap:12px;padding:16px 18px;font-size:15px;font-weight:650;cursor:pointer;list-style:none}
.admin-dictionary-deleted summary::-webkit-details-marker{display:none}
.admin-dictionary-deleted summary svg{flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.admin-dictionary-deleted-count{color:var(--muted);font-weight:600}
.admin-dictionary-deleted-chevron{margin-left:auto;color:var(--muted);transition:transform .15s ease}
.admin-dictionary-deleted summary svg.admin-dictionary-deleted-chevron{width:20px;height:20px;stroke-width:2.2}
.admin-dictionary-deleted[open] .admin-dictionary-deleted-chevron{transform:rotate(180deg)}
.admin-dictionary-deleted-body{border-top:1px solid var(--line)}
.admin-dictionary-deleted-body > .feedback{height:auto;margin:0;padding:12px 18px;border-bottom:1px solid var(--line);text-align:left;max-width:none;line-height:1.45}
.admin-dictionary-deleted-body > .feedback:empty{display:none}
#adminDictionaryNotice{height:auto;margin:0 2px 8px;max-width:none;text-align:left;line-height:1.45}
#adminDictionaryNotice:empty{display:none}
.admin-dictionary-add-deleted{margin:6px 0 0;font-size:13px}
.admin-entry-deleted{background:color-mix(in srgb,var(--danger) 4%,transparent)}
.admin-entry-deleted .admin-entry-definition{color:var(--muted)}
@media(max-width:700px){
  .admin-dictionary-toolbar{flex-wrap:wrap}
  .admin-dictionary-search{flex-basis:100%}
  .admin-dictionary-add-toggle{width:100%}
  .admin-dictionary-add{padding:16px}
  .admin-dictionary-add-buttons button{flex:1;padding:0 12px;white-space:nowrap}
  .admin-entry{gap:8px 10px;padding:12px 14px}
  .admin-copy{flex-direction:column;align-items:stretch;padding:14px}
  .admin-suggestion{padding:14px}
  .admin-editor-footer{flex-direction:column;align-items:stretch}
  .admin-editor-buttons{margin-left:0}
  .admin-editor-buttons button{flex:1;padding:0 10px}
  .admin-dictionary-missing-button{padding:13px 14px}
  .admin-dictionary-deleted summary{padding:14px}
  .admin-dictionary-deleted-body > .feedback{padding:12px 14px}
}

/* SL-189: коллективная игра и слово дня на главной без второго экрана */
.collective-box .mode-rules{margin:10px 0 0;color:var(--muted);font-size:14px;font-weight:650;line-height:1.45}
.collective-box .feedback{height:auto;min-height:0;margin:12px 0 0;text-align:left;max-width:none}
.collective-box .feedback:empty{display:none}
.collective-box .full{margin-top:12px}
.collective-box .full:first-of-type{margin-top:22px}
.collective-progress{margin-top:20px}
.collective-box .collective-progress-line{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:4px 12px;margin:0 0 8px;font-size:15px}
.collective-progress-line b{font-weight:800}
.collective-progress-line #collectiveDoneNote{color:var(--muted);font-size:14px}
.collective-progress-bar{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.collective-progress-bar i{display:block;height:8px;border-radius:999px;background:var(--segmented-bg,var(--line))}
.collective-progress-bar i.done{background:var(--accent)}
@media(max-width:760px){
  .mode-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .mode-picker>label>span{min-height:60px;padding:10px 8px;text-align:center;align-items:center}
  .mode-picker strong{font-size:14px}
  .mode-picker small{display:none}
}

/* Своё слово для одиночной игры (SL-190) */
.solo-word-control{display:grid;gap:10px;min-width:0}
.solo-custom-word{display:grid;gap:8px}
.solo-custom-word .field-input{min-height:48px}
.setting-row .solo-word-hint{min-height:20px;line-height:1.45}
.setting-row .solo-word-hint.ok{color:var(--success)}
.setting-row .solo-word-hint.error{color:var(--danger)}
#startButton:disabled{opacity:.45;cursor:not-allowed}
