/* ==========================================================================
   Habbu — стили внутренних страниц (iframe): словарь, тесты
   Используется в words_list.php, classic_test.php и т.д.
   Токены те же, что в habbu.css — единый вид.
   ========================================================================== */

:root {
  --blue: #0b4f9c;
  --blue-d: #083c78;
  --navy: #051c44;
  --text: #46586f;
  --muted: #8797ab;
  --line: #e9eef6;
  --line-2: #eef2f8;
  --green: #16a34a;
  --amber: #b45309;
  --red: #dc2626;
  --r: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

body.wl,
body.inp {
  margin: 0;
  padding: 0 2px 26px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ============================ ПОИСК + ФИЛЬТРЫ ============================ */

.wl-tools {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding: 10px 2px 8px;
  margin-bottom: 6px;
}

.wl-search { position: relative; display: block; }

.wl-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.wl-search input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fbfcfe;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--navy);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.wl-search input::placeholder { color: #9dabbe; }
.wl-search input:focus {
  background: #fff;
  border-color: #bed7f9;
  box-shadow: 0 0 0 3px rgba(10, 88, 202, 0.1);
}

.wl-chips {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.wl-chips::-webkit-scrollbar { display: none; }

.wl-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 58px;
  padding: 6px 11px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: #3a4c66;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  transition: 0.15s;
}
.wl-chip small { font-size: 11px; font-weight: 500; color: var(--muted); }
.wl-chip:hover { border-color: #cfe2fa; color: var(--blue); }

.wl-chip.on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(10, 88, 202, 0.22);
}
.wl-chip.on small { color: rgba(255, 255, 255, 0.8); }

/* ================================= СПИСОК ================================ */

.wl-list { display: grid; gap: 6px; }

.word-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-left: 3px solid transparent;
  border-radius: var(--r);
}

.word-row .wl-main {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.wl-lvl {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  margin-right: 5px;
  vertical-align: 1px;
  letter-spacing: 0.3px;
}

.wl-star { margin-right: 3px; }
.wl-et { font-weight: 700; }
.wl-sep { color: var(--muted); margin: 0 2px; }
.wl-ru { color: #46586f; }

/* выученное слово */
.word-row.learned {
  background: #f7fbf8;
  border-color: #e6f4ec;
  border-left-color: var(--green);
}
.word-row.learned .wl-main { color: #9aa9bc; }
.word-row.learned .wl-et { text-decoration: line-through; font-weight: 500; }
.word-row.learned .wl-ru { color: #9aa9bc; }

/* золотое слово */
.word-row.golden {
  background: #fffdf6;
  border-color: #fdf0cd;
  border-left-color: #f59e0b;
}

/* ================================ ДЕЙСТВИЯ ============================== */

.word-row .actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.word-row .actions a {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.12s, filter 0.15s;
}
.word-row .actions a:hover { transform: translateY(-1px); filter: brightness(0.97); }

.act-ok   { color: var(--green); background: #eafaf0; border-color: #cdeedd; }
.act-edit { color: var(--amber); background: #fff7e6; border-color: #fde9b0; font-size: 14px; }
.act-del  { color: var(--red);   background: #fef2f2; border-color: #fbdada; font-size: 17px; }

/* ================================ ПУСТОТА =============================== */

.wl-empty {
  padding: 22px 10px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ======================== НИЗ СПИСКА / ЛИМИТ =========================== */

.wl-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 2px;
}

.wl-count {
  font-size: 12.5px;
  color: var(--muted);
  margin-right: auto;
}

.wl-more {
  padding: 9px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: 0.15s;
}
.wl-more:hover { background: #f6faff; border-color: #cfe2fa; }
.wl-more--all { color: #3a4c66; font-weight: 600; }

/* ================================ АДАПТИВ ============================== */

@media (max-width: 420px) {
  .word-row { padding: 8px 8px; gap: 6px; }
  .word-row .wl-main { font-size: 14px; }
  .word-row .actions a { width: 28px; height: 28px; }
  .wl-chip { min-width: 52px; padding: 6px 9px; }
}

/* ============================ ТЕСТ-КАРТОЧКА ============================= */

.test-wrap { max-width: 430px; margin: 0 auto; padding: 4px 2px; }

.test-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px 16px;
  text-align: center;
}

.test-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.test-word {
  font-size: 27px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.6px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.test-trans {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 17px;
  color: #3a4c66;
}
.test-trans.on { display: block; animation: testFade 0.18s ease; }

@keyframes testFade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

.test-actions { margin-top: 14px; display: grid; gap: 8px; }

.test-controls { display: none; grid-template-columns: 1fr 1fr; gap: 8px; }
.test-controls.on { display: grid; }

.test-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 12px 12px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.test-btn:active { transform: translateY(1px); }
.test-btn:disabled { opacity: 0.6; cursor: default; }

.test-btn--show { background: var(--blue); color: #fff; }
.test-btn--show:hover { background: var(--blue-d); }

.test-btn--know { background: var(--green); color: #fff; }
.test-btn--know:hover { background: #15803d; }

.test-btn--next { background: #fff; color: #33456b; border-color: var(--line); }
.test-btn--next:hover { background: #f6faff; color: var(--blue); }

/* подсказка гостю */
.test-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 360px;
  margin: 12px auto 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde9b0;
  text-decoration: none;
  text-align: left;
  transition: background 0.15s;
}
.test-hint:hover { background: #fff7db; }

.test-hint .coin {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #b45309;
  box-shadow: inset -2px -2px 0 #d97706, inset 2px 2px 0 #fde68a;
}

.test-hint b { display: block; font-size: 13.5px; color: #a16207; }
.test-hint span { display: block; font-size: 12.5px; color: #a98963; margin-top: 2px; }

/* всё выучено */
.test-done { text-align: center; padding: 26px 14px; }
.test-done .emoji { font-size: 31px; line-height: 1; }
.test-done h3 { font-size: 17px; margin: 10px 0 4px; color: var(--navy); }
.test-done p { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }

@media (max-width: 400px) {
  .test-word { font-size: 24px; }
  .test-btn { font-size: 13.5px; padding: 11px 8px; }
}

/* ============ общие элементы для будущих внутренних страниц ============= */

.in-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.in-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border: 0;
  border-radius: var(--r);
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.in-btn:hover { background: var(--blue-d); }

.in-btn--ghost {
  background: #fff;
  color: #33456b;
  border: 1px solid var(--line);
}
.in-btn--ghost:hover { background: #f6faff; color: var(--blue); }

.in-title { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.in-muted { font-size: 13px; color: var(--muted); }
