/* ============================================================
   games.css · модали, игри, урочен екран, вход и тест за ниво
   ============================================================ */

/* ============================================================
   ОБЩИ СЛОЕВЕ
   ============================================================ */
.overlay,.game-overlay,.bomb-overlay,.lesson-overlay,.intro-overlay{
  position:fixed; inset:0; z-index:3000;
  background:var(--overlay-bg);
  display:none; align-items:center; justify-content:center;
  padding:18px; overflow-y:auto;
}
.overlay.on,.game-overlay.on,.bomb-overlay.on,.lesson-overlay.on,.intro-overlay.on{ display:flex; }

.modal,.game{
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), transparent 30%),
    var(--paper-2);
  color:var(--ink);
  border:3px solid var(--rule-2);
  border-radius:var(--r-xl);
  padding:26px 24px; max-width:560px; width:100%;
  position:relative; box-shadow:0 22px 50px rgba(40,25,10,.5);
  animation:unfold .3s var(--ease-out); margin:auto;
}
.modal::after,.game::after{
  content:""; position:absolute; inset:6px; pointer-events:none;
  border:1px dashed var(--rule); border-radius:calc(var(--r-xl) - 5px);
}
@keyframes unfold{ from{opacity:0; transform:scale(.94) translateY(14px)} to{opacity:1; transform:none} }

.x,.gx{
  position:absolute; right:14px; top:12px;
  width:38px; height:38px; border-radius:50%;
  border:2px solid var(--rule-2); background:var(--surface-2);
  color:var(--ink); font-size:16px; font-weight:900; cursor:pointer;
  box-shadow:var(--sh-1); z-index:5;
}
.x:hover,.gx:hover{ background:var(--paper-3); }

/* --- Модал с дума --- */
.m-word{ font-family:var(--font-display); font-weight:800; font-size:clamp(29px,7vw,44px); line-height:1.05; padding-right:48px; }
.m-pron{ font-weight:800; font-size:15px; color:var(--sea-d); margin-top:2px; }
.m-bg{ font-weight:900; font-size:21px; margin-top:7px; color:var(--seal); }
.m-sec{ background:var(--surface-2); border:1px solid var(--rule); border-radius:var(--r-sm); padding:12px 14px; margin-top:11px; }
.m-sec .lab{ font-weight:900; font-size:11.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--ink-soft); }
.m-sec .val{ font-weight:800; font-size:15px; margin-top:3px; }
.en-ex{ color:var(--plum); }
.m-actions{ display:flex; gap:10px; margin-top:15px; flex-wrap:wrap; }
.m-hear,.m-quiz{
  flex:1; min-width:130px; border-radius:var(--r-sm);
  padding:12px; font-family:var(--font-body); font-weight:900; font-size:15px;
  cursor:pointer; color:#fdf6e6; border:2px solid;
}
.m-hear{ background:var(--sea); border-color:var(--sea-d); }
.m-quiz{ background:var(--forest); border-color:var(--forest-d); }
.m-nav{ display:flex; gap:10px; margin-top:10px; }
.m-nav button{
  flex:1; border:2px solid var(--rule-2); background:var(--surface-2); color:var(--ink);
  border-radius:var(--r-sm); padding:10px; font-family:var(--font-body); font-weight:900; cursor:pointer;
}

/* ============================================================
   ИГРОВИ МОДАЛ
   ============================================================ */
.ghead{ display:flex; gap:9px; justify-content:center; margin-bottom:13px; flex-wrap:wrap; padding-right:44px; }
.gstat{
  font-weight:900; font-size:14.5px; border-radius:var(--r-sm); padding:6px 13px;
  background:var(--surface-2); border:2px solid var(--rule);
}
.gstat.score{ color:var(--gold-d); }
.gstat.streak{ color:var(--rust-d); }
.gstat.fire{ background:var(--rust); color:#fdf6e6; border-color:var(--rust-d); }
.gprompt{ text-align:center; font-family:var(--font-hand); font-size:21px; color:var(--ink-soft); margin-bottom:8px; }
.gword{
  text-align:center; font-family:var(--font-display); font-weight:800;
  font-size:clamp(31px,8vw,52px); line-height:1.05; word-break:break-word;
}
.gword-hear{
  display:block; margin:10px auto 4px;
  border:2px solid var(--rule-2); background:var(--surface-2); color:var(--ink);
  border-radius:var(--r-sm); padding:7px 17px; font-weight:900; font-size:13.5px; cursor:pointer;
}
.gword-hear:hover{ background:var(--paper-3); }
.gopts{ display:grid; gap:10px; margin-top:15px; }
.gopt{
  border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  border-radius:var(--r-md); padding:14px 16px;
  font-family:var(--font-body); font-weight:900; font-size:16px;
  cursor:pointer; text-align:left; box-shadow:0 2px 0 var(--rule);
  transition:transform .14s var(--ease), background .2s;
}
.gopt:hover:not(.locked){ transform:translateY(-2px); background:var(--surface-2); }
.gopt.locked{ cursor:default; }
.gopt.right{ background:var(--forest); color:#fdf6e6; border-color:var(--forest-d); box-shadow:0 2px 0 var(--forest-d); }
.gopt.wrong{ background:var(--seal); color:#fdf6e6; border-color:var(--seal-d); box-shadow:0 2px 0 var(--seal-d); }
.gfeed{ text-align:center; font-weight:900; font-size:15px; margin-top:13px; min-height:22px; }
.gfeed.ok{ color:var(--forest); }
.gfeed.no{ color:var(--seal); }
.gnext{
  display:block; width:100%; margin-top:10px;
  border:2px solid var(--plum-d); border-radius:var(--r-md); padding:13px;
  background:var(--plum); color:#fdf6e6;
  font-family:var(--font-body); font-weight:900; font-size:16px; cursor:pointer;
  box-shadow:0 3px 0 var(--plum-d);
}
.gnext:active{ transform:translateY(2px); box-shadow:0 1px 0 var(--plum-d); }

/* --- Напиши думата --- */
.sp-bg{ text-align:center; font-weight:900; font-size:21px; color:var(--seal); }
.sp-slots{ display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin:15px 0; }
.sp-slot{
  width:40px; height:50px; border-radius:var(--r-sm);
  border:2px dashed var(--rule-2); background:var(--surface-2);
  display:grid; place-items:center;
  font-family:var(--font-display); font-weight:800; font-size:24px;
}
.sp-slot.fill{ border-style:solid; border-color:var(--forest); background:rgba(47,107,77,.12); }
.sp-letters{ display:flex; gap:7px; justify-content:center; flex-wrap:wrap; }
.sp-tile{
  width:44px; height:50px; border-radius:var(--r-sm);
  border:2px solid var(--rule-2); background:var(--paper-2);
  font-family:var(--font-display); font-weight:800; font-size:23px; cursor:pointer;
  box-shadow:0 2px 0 var(--rule); color:var(--ink);
}
.sp-tile:hover{ background:var(--surface-2); }
.sp-tile.used{ opacity:.2; pointer-events:none; }

/* --- Подреди изречението --- */
.st-key{
  text-align:center; font-weight:900; font-size:13.5px; color:var(--plum);
  background:rgba(107,63,110,.12); border:1px solid var(--plum);
  border-radius:var(--r-sm); padding:6px 13px; display:inline-block;
  margin:0 auto 6px;
}
.st-area{
  min-height:64px; border:2px dashed var(--rule-2); border-radius:var(--r-md);
  background:var(--surface-2); padding:10px; display:flex; gap:6px; flex-wrap:wrap;
  align-items:center; justify-content:center; margin:12px 0;
}
.st-area.done{ border-style:solid; border-color:var(--forest); }
.st-pool{ display:flex; gap:7px; flex-wrap:wrap; justify-content:center; }
.st-tile{
  border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  border-radius:var(--r-sm); padding:9px 13px;
  font-family:var(--font-body); font-weight:900; font-size:15.5px; cursor:pointer;
  box-shadow:0 2px 0 var(--rule);
}
.st-tile.used{ opacity:.2; pointer-events:none; }
.st-tile.placed{ background:var(--sea); color:#fdf6e6; border-color:var(--sea-d); box-shadow:0 2px 0 var(--sea-d); }

/* --- Диктовка --- */
.dict-input{
  width:100%; border:2px solid var(--rule-2); background:var(--surface-2); color:var(--ink);
  border-radius:var(--r-md); padding:14px 15px; margin-top:13px;
  font-family:var(--font-body); font-weight:800; font-size:17px; outline:none;
}
.dict-input:focus{ border-color:var(--sea); }
.dict-input.ok{ border-color:var(--forest); background:rgba(47,107,77,.1); }
.dict-input.no{ border-color:var(--seal); background:rgba(143,47,43,.1); }

/* --- Кажи го ти --- */
.mic-btn{
  display:block; margin:16px auto 8px;
  width:90px; height:90px; border-radius:50%;
  border:3px double #f0d9b8;
  background:radial-gradient(circle at 34% 30%, #b8433c, var(--seal) 55%, var(--seal-d));
  color:#fff; font-size:38px; cursor:pointer;
  box-shadow:0 4px 0 var(--seal-d);
}
.mic-btn.listening{ animation:sealPulse 1.2s ease-in-out infinite; }
.mic-status{ text-align:center; font-weight:800; font-size:13.5px; color:var(--ink-soft); }

/* --- Двойки --- */
.pr-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:13px; }
.pr-card{
  aspect-ratio:1.25; border:2px solid var(--rule-2); background:var(--surface-2); color:var(--ink);
  border-radius:var(--r-md); font-family:var(--font-body); font-weight:900; font-size:14px;
  cursor:pointer; padding:6px; word-break:break-word; box-shadow:0 2px 0 var(--rule);
}
.pr-card.open{ background:var(--sea); color:#fdf6e6; border-color:var(--sea-d); }
.pr-card.done{ background:var(--forest); color:#fdf6e6; border-color:var(--forest-d); opacity:.6; pointer-events:none; }

/* --- Звуци --- */
.ph-say{
  display:block; margin:6px auto 10px; width:82px; height:82px; border-radius:50%;
  border:3px double #f0d9b8; background:radial-gradient(circle at 34% 30%, #3f77ad, var(--sea) 55%, var(--sea-d));
  color:#fff; font-size:34px; cursor:pointer; box-shadow:0 4px 0 var(--sea-d);
}
.ph-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:9px; margin-top:13px; }
.ph-opt{
  aspect-ratio:1; border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  border-radius:var(--r-md); font-family:var(--font-display); font-weight:800; font-size:22px;
  cursor:pointer; box-shadow:0 2px 0 var(--rule);
}
.ph-opt.right{ background:var(--forest); color:#fdf6e6; border-color:var(--forest-d); }
.ph-opt.wrong{ background:var(--seal); color:#fdf6e6; border-color:var(--seal-d); }

/* --- Картинки --- */
.pic-big{ text-align:center; font-size:clamp(70px,20vw,116px); line-height:1.1; }

/* --- Празното място --- */
.blank-sent{
  text-align:center; font-family:var(--font-display); font-weight:800;
  font-size:clamp(20px,4.6vw,29px); line-height:1.45; margin:8px 0;
}
.blank-sent .gap{ display:inline-block; min-width:94px; border-bottom:4px solid var(--gold); color:var(--gold-d); }

/* --- Глаголи --- */
.verb-base{ text-align:center; font-family:var(--font-display); font-weight:800; font-size:clamp(29px,7vw,44px); }
.verb-bg{ text-align:center; font-weight:900; font-size:16px; color:var(--seal); margin-top:2px; }

/* --- Истории и книги --- */
.rd-game{ max-height:88vh; overflow-y:auto; }
.sr-section{
  font-family:var(--font-display); font-weight:800; font-size:15px; color:var(--ink-soft);
  margin:14px 0 8px; padding-bottom:4px; border-bottom:2px dashed var(--rule);
}
.sr-section:first-child{ margin-top:2px; }

/* голямата книга — по-голяма корица-карта над кратките истории */
.sr-book{
  display:flex; align-items:center; gap:14px; width:100%; text-align:left;
  border:2px solid var(--gold); background:linear-gradient(135deg,var(--surface-2),var(--paper-3));
  border-radius:var(--r-lg); padding:14px 16px; margin-bottom:14px; cursor:pointer;
  box-shadow:0 4px 0 var(--gold-d), var(--sh-2);
  transition:transform .16s var(--ease);
}
.sr-book:hover{ transform:translateY(-2px); }
.sr-book-cover{
  flex:none; width:56px; height:56px; border-radius:var(--r-md);
  background:var(--paper-2); border:2px solid var(--rule-2);
  display:grid; place-items:center; font-size:30px; box-shadow:var(--sh-1);
}
.sr-book-info{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.sr-book-title{ font-family:var(--font-display); font-weight:800; font-size:17px; color:var(--ink); }
.sr-book-sub{ font-weight:700; font-size:12.5px; color:var(--ink-soft); }
.sr-book-progress{ font-weight:900; font-size:12px; color:var(--gold-d); margin-top:2px; }
.sr-book-progress.done{ color:var(--forest-d); }
.sr-book-go{ flex:none; font-size:20px; color:var(--gold-d); }

.sr-item{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  border:2px solid var(--rule); background:var(--surface-2); color:var(--ink);
  border-radius:var(--r-md); padding:11px 13px; margin-bottom:8px;
  font-family:var(--font-body); font-weight:900; font-size:15px; cursor:pointer;
  box-shadow:0 2px 0 var(--rule);
}
.sr-item:hover{ background:var(--paper-3); }
.sr-item .lvl{ color:#fdf6e6; font-size:11px; border-radius:3px; padding:2px 9px; flex:none; }
.sr-item .ttl{ flex:1; min-width:0; }
.sr-item .donemark{ font-size:16px; }

/* навигация по глави */
.rd-booknav{ display:flex; align-items:center; gap:10px; margin-bottom:6px; padding-right:42px; }
.rd-navbtn{
  flex:none; width:34px; height:34px; border-radius:50%; cursor:pointer;
  border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  font-weight:900; font-size:15px; box-shadow:0 2px 0 var(--rule-2);
}
.rd-navbtn:disabled{ opacity:.35; cursor:default; box-shadow:none; }
.rd-bookinfo{ flex:1; min-width:0; text-align:center; display:flex; flex-direction:column; }
.rd-booktitle{ font-family:var(--font-display); font-weight:800; font-size:14.5px; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rd-chapterbadge{ font-weight:900; font-size:12px; color:var(--gold-d); }
.rd-dots{ display:flex; gap:5px; justify-content:center; margin-bottom:10px; flex-wrap:wrap; }
.rd-dot{ width:9px; height:9px; border-radius:50%; background:var(--paper-3); border:1px solid var(--rule-2); }
.rd-dot.active{ background:var(--gold); border-color:var(--gold-d); transform:scale(1.25); }
.rd-dot.done{ background:var(--forest); border-color:var(--forest-d); }

.sr-title{ font-family:var(--font-display); font-weight:800; font-size:23px; margin:6px 0 10px; }

/* лента за прогрес — докъде се чете в текущата глава/история */
.rd-progress{ height:6px; border-radius:99px; background:var(--paper-3); border:1px solid var(--rule-2); overflow:hidden; margin-bottom:12px; }
.rd-progress-fill{ height:100%; width:0%; border-radius:99px; background:linear-gradient(90deg,var(--gold),var(--sun)); transition:width .25s var(--ease-out); }

/* текстът на историята — всяко изречение е свой ред, за да се вижда ясно кое се чете сега */
.sr-text{
  font-family:var(--font-display); font-weight:500; font-size:19px; line-height:1.9;
  background:var(--surface-2); border:1px solid var(--rule);
  border-radius:var(--r-md); padding:6px 6px; max-height:44vh; overflow-y:auto;
}
.rd-line{
  margin:0; padding:8px 12px; border-radius:var(--r-sm);
  border-left:5px solid transparent; transition:background .2s, border-color .2s;
}
.rd-line.on{ background:var(--paper-3); border-left-color:var(--plum); }
.rd-w{ cursor:pointer; border-radius:4px; padding:0 1px; transition:background .12s, color .12s, transform .12s; }
.rd-w:hover{ background:var(--paper-3); }
.rd-w.on{
  background:var(--gold); color:#3a2a05; font-weight:800;
  box-shadow:0 0 0 3px rgba(200,144,28,.28); transform:scale(1.04); display:inline-block;
}
.rd-taphint{ text-align:center; font-weight:700; font-size:12px; color:var(--ink-faint); margin-top:6px; }
.rd-toolbar{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
.rd-select-label{ display:flex; align-items:center; gap:5px; border:2px solid var(--rule-2); border-radius:var(--r-sm); padding:7px 9px; background:var(--paper-2); font-size:12px; font-weight:900; color:var(--ink-soft); }
.rd-select-label select{ border:0; background:transparent; color:var(--ink); font:inherit; font-weight:900; outline:none; cursor:pointer; }
.rd-bookmarks{ background:var(--paper-2); color:var(--ink); box-shadow:0 6px 0 var(--rule-2); }
.rd-play.playing{ background:linear-gradient(135deg,var(--seal),#c4534a) !important; box-shadow:0 6px 0 var(--seal-d) !important; }

.sr-vocab{ display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.sr-vchip{
  border:1px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  border-radius:3px; padding:5px 12px; font-weight:900; font-size:12.5px; cursor:pointer;
}
.sr-q{ text-align:center; font-family:var(--font-display); font-weight:800; font-size:clamp(19px,4vw,25px); margin:8px 0; }
.sr-hint{ text-align:center; font-weight:800; font-size:13.5px; color:var(--plum); min-height:19px; }

/* изскачаща картичка при клик върху дума в текста */
.word-pop{
  display:none; position:fixed; inset:0; z-index:60;
  background:var(--overlay-bg); align-items:center; justify-content:center; padding:20px;
}
.word-pop.show{ display:flex; }
.word-pop-card{
  position:relative; width:min(360px,92vw); background:var(--paper-2);
  border:2px solid var(--gold); border-radius:var(--r-lg); padding:26px 22px 20px;
  text-align:center; box-shadow:var(--sh-3);
}
.word-pop-x{
  position:absolute; top:8px; right:10px; border:none; background:none; cursor:pointer;
  font-size:16px; color:var(--ink-soft); font-weight:900;
}
.word-pop-en{ font-family:var(--font-display); font-weight:800; font-size:26px; color:var(--ink); }
.word-pop-hear{
  margin:8px auto 4px; display:block; border:none; cursor:pointer; border-radius:50%;
  width:40px; height:40px; font-size:18px; background:var(--sea); color:#fff; box-shadow:0 3px 0 var(--sea-d);
}
.word-pop-bg{ font-weight:800; font-size:16px; color:var(--seal); margin-top:6px; }
.word-pop-ex{ font-weight:600; font-size:13px; color:var(--ink-soft); margin-top:10px; font-style:italic; }
.word-pop-google{ margin-top:10px; padding:10px; border-radius:var(--r-sm); background:var(--surface-2); color:var(--ink); font-weight:800; line-height:1.45; }
.word-pop-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.word-pop-actions .mini{ text-decoration:none; cursor:pointer; font-family:var(--font-body); }
.bookmark-list{ margin-top:14px; display:grid; gap:8px; max-height:50vh; overflow:auto; }
.bookmark-item{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px; background:var(--paper-3); border-radius:var(--r-sm); font-weight:800; }
.bookmark-item .en{ font-family:var(--font-display); font-size:17px; }.bookmark-item .bg{ color:var(--seal); font-size:13px; }.bookmark-empty{ color:var(--ink-soft); font-weight:800; padding:14px 0; }

/* --- Аркадни игри --- */
.bomb-overlay{ padding:0; background:rgba(10,6,2,.94); }
.bomb-overlay iframe{ width:100%; height:100%; border:none; display:block; }
.bomb-close{
  position:fixed; right:14px; top:14px; z-index:20;
  width:46px; height:46px; border-radius:50%; border:3px double #f0d9b8;
  background:var(--seal); color:#fff; font-size:19px; font-weight:900; cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.5);
}

/* ============================================================
   УРОК
   ============================================================ */
.lesson-overlay{ background:var(--paper); padding:0; align-items:stretch; }
.lesson{
  width:100%; max-width:700px; margin:0 auto;
  display:flex; flex-direction:column; min-height:100dvh;
  padding:14px 16px 22px; position:relative; z-index:1;
}
.ls-top{ display:flex; align-items:center; gap:12px; margin-bottom:6px; }
.ls-quit{
  width:40px; height:40px; flex:none; border-radius:50%;
  border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  font-size:16px; font-weight:900; cursor:pointer; box-shadow:var(--sh-1);
}
.ls-bar{
  flex:1; height:16px; background:var(--paper-3); border:2px solid var(--rule-2);
  border-radius:9px; overflow:hidden;
}
.ls-bar i{ display:block; height:100%; width:0; background:var(--gold); transition:width .45s var(--ease-out); }
.ls-hearts{ font-size:17px; flex:none; letter-spacing:1px; }
.ls-title{ font-family:var(--font-hand); font-size:19px; color:var(--ink-soft); text-align:center; margin-bottom:14px; }

.ls-body{ flex:1; display:flex; flex-direction:column; justify-content:center; }
.ls-card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), transparent 28%),
    var(--paper-2);
  border:3px solid var(--rule-2);
  border-radius:var(--r-xl); padding:24px 20px;
  box-shadow:var(--sh-2); position:relative;
}
.ls-card::after{
  content:""; position:absolute; inset:6px; pointer-events:none;
  border:1px dashed var(--rule); border-radius:calc(var(--r-xl) - 5px);
}
.ls-q{ font-family:var(--font-hand); font-size:21px; color:var(--ink-soft); text-align:center; margin-bottom:10px; }
.ls-big{
  text-align:center; font-family:var(--font-display); font-weight:800;
  font-size:clamp(30px,7.5vw,50px); line-height:1.08; word-break:break-word;
}
.ls-sub{ text-align:center; font-weight:900; font-size:18px; color:var(--seal); margin-top:6px; }
.ls-pron{ text-align:center; font-weight:800; font-size:14.5px; color:var(--sea-d); margin-top:3px; }
.ls-emoji{ text-align:center; font-size:clamp(62px,18vw,106px); line-height:1.15; }
.ls-example{
  text-align:center; font-weight:800; font-size:14.5px; color:var(--plum);
  background:var(--surface-2); border:1px solid var(--rule);
  border-radius:var(--r-sm); padding:10px 13px; margin-top:12px;
}
.ls-sentence{
  text-align:center; font-family:var(--font-display); font-weight:800;
  font-size:clamp(19px,4.4vw,28px); line-height:1.5;
}
.ls-sentence .gap{ display:inline-block; min-width:92px; border-bottom:4px solid var(--gold); color:var(--gold-d); }

.ls-rule{
  background:var(--surface-2); border:1px solid var(--rule);
  border-radius:var(--r-sm); border-left:5px solid var(--plum);
  padding:13px 15px; margin-top:12px;
}
.ls-rule .rw{ font-weight:800; font-size:14.5px; }
.ls-rules{ display:flex; flex-direction:column; gap:7px; margin-top:12px; }
.ls-rules .rr{
  display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; cursor:pointer;
  background:var(--surface-2); border:1px solid var(--rule);
  border-radius:var(--r-sm); padding:9px 12px;
}
.ls-rules .rr:hover{ background:var(--paper-3); }
.ls-rules .re{ font-family:var(--font-display); font-weight:800; font-size:16px; color:var(--plum); }
.ls-rules .rb{ font-weight:800; font-size:13.5px; color:var(--ink-soft); }
.ls-tip{
  background:rgba(200,144,28,.14); border:2px solid var(--gold);
  border-radius:var(--r-sm); padding:12px 14px; font-weight:800; font-size:14px; margin-top:13px;
}
.ls-more{
  text-align:center; margin-top:8px; font-weight:800; font-size:13px; color:var(--plum);
  background:rgba(107,63,110,.1); border-radius:var(--r-sm); padding:7px 11px;
}
.more-hint{ display:block; font-size:12.5px; font-weight:800; opacity:.9; margin-top:5px; color:var(--ink-soft); }
.card .more{ font-weight:800; font-size:12.5px; color:var(--plum); margin-top:4px; padding-left:9px; }

.ls-foot{ margin-top:15px; }
.ls-check{
  display:block; width:100%;
  border:2px solid var(--forest-d); border-radius:var(--r-md); padding:15px;
  background:var(--forest); color:#fdf6e6;
  font-family:var(--font-body); font-weight:900; font-size:17px; cursor:pointer;
  box-shadow:0 4px 0 var(--forest-d);
}
.ls-check:disabled{ opacity:.4; cursor:default; background:var(--paper-3); color:var(--ink-faint); border-color:var(--rule); box-shadow:0 4px 0 var(--rule); }
.ls-check:active:not(:disabled){ transform:translateY(3px); box-shadow:0 1px 0 var(--forest-d); }
.ls-feed{
  border-radius:var(--r-sm); padding:13px 15px; font-weight:900; font-size:15px;
  margin-bottom:11px; display:none; border:2px solid;
}
.ls-feed.on{ display:block; animation:unroll .25s; }
.ls-feed.ok{ background:rgba(47,107,77,.14); color:var(--forest); border-color:var(--forest); }
.ls-feed.no{ background:rgba(143,47,43,.12); color:var(--seal); border-color:var(--seal); }
.ls-feed small{ display:block; font-size:13px; font-weight:800; opacity:.88; margin-top:4px; }

.ls-done{ text-align:center; padding:18px 0; }
.ls-fox-cheer{
  display:flex; align-items:center; gap:12px; justify-content:center;
  text-align:left; margin-bottom:14px;
}
.ls-fox-img{
  width:60px; height:60px; flex:none; border-radius:50%;
  box-shadow:0 4px 0 var(--seal-d), 0 8px 16px rgba(90,40,30,.32);
  animation:stamp .5s var(--ease-out);
}
.ls-fox-bubble{
  position:relative; background:var(--surface-2); border:2px solid var(--rule);
  border-radius:var(--r-sm); padding:10px 14px; font-weight:800; font-size:14.5px;
  max-width:240px; box-shadow:var(--sh-1);
}
.ls-fox-bubble::before{
  content:""; position:absolute; left:-9px; top:50%; transform:translateY(-50%);
  border:8px solid transparent; border-right-color:var(--rule);
}
.ls-fox-bubble::after{
  content:""; position:absolute; left:-6.5px; top:50%; transform:translateY(-50%);
  border:6.5px solid transparent; border-right-color:var(--surface-2);
}
.ls-done .de{ font-size:80px; }
.ls-done .dt{ font-family:var(--font-display); font-weight:800; font-size:29px; margin-top:6px; }
.ls-done .ds{ font-weight:800; font-size:15px; color:var(--ink-soft); margin-top:6px; }
.ls-done .dstars{ font-size:42px; letter-spacing:6px; margin-top:10px; color:var(--gold); }
.ls-done .dgrid{ display:flex; gap:14px; justify-content:center; margin-top:16px; flex-wrap:wrap; }
.ls-done .dstat b{ display:block; font-family:var(--font-display); font-size:25px; }
.ls-done .dstat span{ font-weight:800; font-size:12px; color:var(--ink-soft); }

.ls-newword{ display:flex; flex-direction:column; align-items:center; gap:3px; }
.ls-speak{
  border:2px solid var(--sea-d); background:var(--sea); color:#fdf6e6;
  border-radius:var(--r-sm); padding:9px 19px; font-weight:900; font-size:14.5px;
  cursor:pointer; margin-top:12px;
}

/* --- Мисия --- */
.quest-card{ text-align:center; }
.quest-emoji{ font-size:72px; line-height:1.15; }
.quest-goal{ font-family:var(--font-hand); font-size:23px; margin-top:8px; color:var(--plum); }
.quest-bar{ height:18px; background:var(--paper-3); border:2px solid var(--rule-2); border-radius:10px; overflow:hidden; margin:13px 0 7px; }
.quest-bar i{ display:block; height:100%; background:var(--plum); transition:width .6s var(--ease-out); }
.quest-count{ font-family:var(--font-display); font-weight:800; font-size:25px; }

/* ============================================================
   ВХОД И ТЕСТ ЗА НИВО
   ============================================================ */
.intro-overlay{ background:var(--paper); padding:0; align-items:stretch; }
.intro{
  width:100%; max-width:640px; margin:auto;
  padding:26px 20px 40px; position:relative; z-index:1;
  display:flex; flex-direction:column; justify-content:center; min-height:100dvh;
}
.intro-card{
  background:linear-gradient(180deg, rgba(255,255,255,.42), transparent 26%), var(--paper-2);
  border:3px solid var(--rule-2); border-radius:var(--r-xl);
  padding:28px 24px; box-shadow:var(--sh-3); position:relative;
}
.intro-card::after{
  content:""; position:absolute; inset:7px; pointer-events:none;
  border:1px dashed var(--rule); border-radius:calc(var(--r-xl) - 6px);
}
.intro-fox{
  width:96px; height:96px; margin:0 auto 12px; display:grid; place-items:center;
  font-size:54px; border-radius:50%;
  background:radial-gradient(circle at 34% 30%, #fff6e2, var(--paper-3));
  border:3px dashed var(--rule-2);
}
.intro h2{
  font-family:var(--font-display); font-weight:800; text-align:center;
  font-size:clamp(24px,5.4vw,34px); margin:0; line-height:1.12;
}
.intro .lead{
  font-family:var(--font-hand); font-size:21px; text-align:center;
  color:var(--ink-soft); margin-top:6px; line-height:1.3;
}
.intro .steps{ display:flex; gap:6px; justify-content:center; margin-bottom:18px; }
.intro .steps i{
  width:9px; height:9px; border-radius:50%; background:var(--rule);
  border:1px solid var(--rule-2); display:block;
}
.intro .steps i.on{ background:var(--seal); border-color:var(--seal-d); }

.opt-list{ display:grid; gap:11px; margin-top:20px; }
.opt-btn{
  display:flex; align-items:center; gap:14px; text-align:left; cursor:pointer;
  border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  border-radius:var(--r-md); padding:15px 17px; box-shadow:0 2px 0 var(--rule);
  font-family:var(--font-body);
  transition:transform .16s var(--ease), background .2s, border-color .2s;
}
.opt-btn:hover{ transform:translateY(-2px); background:var(--surface-2); border-color:var(--seal); }
.opt-btn .oe{ font-size:32px; flex:none; font-family:var(--font-display); font-weight:800; }
.opt-btn > span:last-child{ display:block; min-width:0; }
.opt-btn .ot{ display:block; font-family:var(--font-display); font-weight:800; font-size:19px; line-height:1.2; }
.opt-btn .od{ display:block; font-weight:700; font-size:12.5px; color:var(--ink-soft); margin-top:2px; line-height:1.45; }
.opt-btn.seal{ background:var(--seal); color:#fdf6e6; border-color:var(--seal-d); box-shadow:0 3px 0 var(--seal-d); }
.opt-btn.seal .od{ color:rgba(253,246,230,.85); }

.intro-name{
  width:100%; border:2px solid var(--rule-2); background:var(--surface-2); color:var(--ink);
  border-radius:var(--r-md); padding:14px 16px; margin-top:18px;
  font-family:var(--font-display); font-weight:800; font-size:20px; text-align:center; outline:none;
}
.intro-name:focus{ border-color:var(--seal); }
.intro-skip{
  display:block; margin:14px auto 0; background:none; border:none;
  color:var(--ink-soft); font-family:var(--font-body); font-weight:900; font-size:13.5px;
  text-decoration:underline; cursor:pointer;
}

/* --- Решетка с нива --- */
.lv-grid{ display:grid; gap:10px; margin-top:18px; }
.lv-btn{
  display:flex; align-items:center; gap:14px; text-align:left; cursor:pointer;
  border:2px solid var(--rule-2); background:var(--paper-2); color:var(--ink);
  border-radius:var(--r-md); padding:13px 15px; box-shadow:0 2px 0 var(--rule);
  transition:transform .16s var(--ease), border-color .2s;
}
.lv-btn:hover{ transform:translateY(-2px); border-color:var(--seal); }
.lv-btn .lvi{ font-size:30px; flex:none; }
.lv-btn .lvc{
  font-family:var(--font-display); font-weight:800; font-size:15px;
  color:#fdf6e6; background:var(--plum); border:2px solid var(--plum-d);
  border-radius:3px; padding:1px 10px; flex:none;
}
.lv-btn > span:last-child{ display:block; min-width:0; }
.lv-btn .lvn{ display:block; font-family:var(--font-display); font-weight:800; font-size:17px; }
.lv-btn .lvd{ display:block; font-weight:700; font-size:12px; color:var(--ink-soft); margin-top:1px; line-height:1.4; }

/* --- Тест за ниво --- */
.test-head{
  display:flex; align-items:center; gap:12px; margin-bottom:16px;
}
.test-head .tbar{
  flex:1; height:14px; background:var(--paper-3); border:2px solid var(--rule-2);
  border-radius:8px; overflow:hidden;
}
.test-head .tbar i{ display:block; height:100%; background:var(--sea); transition:width .4s var(--ease-out); }
.test-head .tnum{ font-weight:900; font-size:13px; color:var(--ink-soft); flex:none; }
.test-level{
  font-family:var(--font-hand); font-size:19px; color:var(--ink-soft);
  text-align:center; margin-bottom:10px;
}
.result-seal{
  width:150px; height:150px; margin:0 auto 6px; display:grid; place-items:center;
  border-radius:50%; color:#fdf6e6;
  background:radial-gradient(circle at 34% 30%, #b8433c, var(--seal) 55%, var(--seal-d));
  border:5px double #f0d9b8;
  box-shadow:0 6px 0 var(--seal-d), 0 16px 30px rgba(90,40,30,.4);
  animation:stamp .5s var(--ease-out);
}
.result-seal b{ font-family:var(--font-display); font-size:46px; line-height:1; display:block; }
.result-seal span{ font-family:var(--font-hand); font-size:17px; }
@keyframes stamp{
  0%{ transform:scale(2.4) rotate(-14deg); opacity:0; }
  60%{ transform:scale(.92) rotate(3deg); opacity:1; }
  100%{ transform:scale(1) rotate(0); }
}

@media (max-width:640px){
  .modal,.game{ padding:22px 15px; }
  .pr-grid{ gap:6px; }
  .ph-grid{ gap:7px; }
  .lesson{ padding:12px 12px 18px; }
  .intro{ padding:18px 14px 30px; }
  .intro-card{ padding:22px 16px; }
  .intro-fox{ width:80px; height:80px; font-size:45px; }
}

/* ============================================================
   Портата на света · „Какво трябва да можеш"
   ============================================================ */
.intro-card.gate{ text-align:center; }
.gate-badge{
  width:104px; height:104px; margin:0 auto 14px;
  display:grid; place-items:center; border-radius:50%;
  background:
    linear-gradient(160deg, rgba(46,30,14,.42), rgba(46,30,14,.66)),
    linear-gradient(135deg, var(--wc,#8f2f2b), var(--wc2,#5f1c1a));
  border:3px solid var(--rule-2);
  box-shadow:var(--sh-2); color:#fdf6e6; position:relative;
}
.gate-badge .ge{ font-size:44px; line-height:1; filter:drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.gate-badge .gc{
  position:absolute; bottom:-9px;
  font-family:var(--font-display); font-weight:800; font-size:14px;
  letter-spacing:1.6px; padding:1px 12px; border-radius:3px;
  background:var(--paper-2); color:var(--ink); border:2px solid var(--rule-2);
}
.gate-can{
  margin-top:16px; padding:13px 15px; text-align:left;
  background:var(--surface-2); border:2px dashed var(--rule-2);
  border-radius:var(--r-md); font-weight:700; font-size:14px; line-height:1.55;
}
.gate-sec{
  margin-top:20px; text-align:left;
  font-family:var(--font-display); font-weight:800; font-size:19px;
  padding-bottom:7px; border-bottom:2px dotted var(--rule);
}
.gate-list{
  list-style:none; margin:12px 0 0; padding:0; text-align:left;
}
.gate-list li{
  position:relative; padding:7px 0 7px 27px;
  font-weight:700; font-size:14px; line-height:1.5;
  border-bottom:1px dashed var(--rule);
}
.gate-list li:last-child{ border-bottom:none; }
.gate-list li::before{
  content:"✔"; position:absolute; left:2px; top:7px;
  color:var(--forest); font-weight:900; font-size:13px;
}
.gate-row{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:16px; }
.gate-chip{
  font-weight:900; font-size:12.5px; padding:5px 12px;
  border-radius:var(--r-sm); background:var(--paper-3);
  border:1px solid var(--rule-2); color:var(--ink);
}
.gate-chip.done{ background:var(--forest); border-color:var(--forest-d); color:#fdf6e6; }

/* бутонът в заглавието на света */
.wmust{
  margin-top:9px; cursor:pointer;
  font-family:var(--font-body); font-weight:900; font-size:12px;
  color:#fdf6e6; background:rgba(0,0,0,.26);
  border:1px solid rgba(255,255,255,.42); border-radius:var(--r-sm);
  padding:5px 11px; transition:background .2s;
}
.wmust:hover{ background:rgba(0,0,0,.42); }

@media (max-width:520px){
  .gate-badge{ width:84px; height:84px; }
  .gate-badge .ge{ font-size:36px; }
  .gate-sec{ font-size:17px; }
  .gate-list li{ font-size:13.5px; }
}
