:root{
  --void:#080b1e;
  --panel:#101733;
  --panel-2:#141c3c;
  --panel-3:#1a2348;
  --line: rgba(255,255,255,0.09);
  --gold:#f5a623;
  --gold-soft:#ffcf7d;
  --violet:#8b7cf6;
  --magenta:#ef62d8;
  --teal:#2fd6b0;
  --sky:#4fa3f7;
  --hi:#f6f7ff;
  --mid:#9aa3c8;
  --dim:#5c6491;
  --sidebar-w:232px;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{ scroll-behavior:smooth; }
body{
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(239,98,216,0.10), transparent 55%),
    radial-gradient(800px 500px at 8% 100%, rgba(79,163,247,0.08), transparent 55%),
    var(--void);
  color:var(--hi); font-family:'Manrope', sans-serif; min-height:100vh;
  opacity:0; animation:pageIn .35s ease forwards;
}
/* ВАЖНО: анимация ниже намеренно НЕ использует transform.
   Transform (даже нулевой) на body превращает position:fixed у всех потомков
   в позиционирование относительно body, а не экрана — из-за этого перетаскиваемые
   элементы "вылетали" не с того места. */
@keyframes pageIn{ from{ opacity:0; } to{ opacity:1; } }
body.leaving{ animation:pageOut .22s ease forwards; }
@keyframes pageOut{ to{ opacity:0; } }

h1,h2,h3,h4,h5,.disp{ font-family:'Unbounded', sans-serif; letter-spacing:-0.01em; }
.mono{ font-family:'JetBrains Mono', monospace; }
a{ color:inherit; text-decoration:none; }
img{max-width:100%; display:block;}
button{font-family:inherit;}

.shell{ display:flex; min-height:100vh; }

/* ---- SIDEBAR ---- */
.sidebar{
  width:var(--sidebar-w); flex:none; background:#0a0f26;
  border-right:1px solid var(--line);
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; padding:20px 14px; z-index:80;
}
.logo{ display:flex; align-items:center; gap:8px; padding:4px 4px 20px; }
.logo img{ height:30px; width:auto; }

.nav{ display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto; }
.nav-item{
  display:flex; align-items:center; gap:11px; padding:10px 11px; border-radius:10px;
  font-size:12.5px; font-weight:600; color:var(--mid); cursor:pointer; border:1px solid transparent;
  transition:all .15s ease; line-height:1.25;
}
.nav-item .ico{ width:18px; text-align:center; font-size:14.5px; flex:none; }
.nav-item small{ display:block; font-size:9.5px; color:var(--dim); font-weight:600; }
.nav-item:hover{ background:var(--panel-2); color:var(--hi); }
.nav-item.active{
  background:linear-gradient(90deg, rgba(47,214,176,0.22), rgba(47,214,176,0.03));
  border-color:rgba(47,214,176,0.4); color:var(--hi);
}
.nav-item.active .ico{ color:var(--teal); }

.sidebar-foot{ padding-top:12px; margin-top:8px; border-top:1px solid var(--line); }
.logout-btn{
  width:100%; display:flex; align-items:center; gap:10px; padding:10px 11px; border-radius:10px;
  background:transparent; border:1px solid transparent; color:var(--mid); font-size:12.5px; font-weight:700; cursor:pointer;
}
.logout-btn:hover{ color:var(--gold); border-color:var(--line); background:var(--panel-2); }

/* ---- MAIN ---- */
.main{ flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar{
  position:sticky; top:0; z-index:60;
  background:rgba(8,11,30,0.92); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:14px 26px; flex-wrap:wrap;
}
.mobile-menu-btn{ display:none; width:36px; height:36px; border-radius:10px; background:var(--panel-2); border:1px solid var(--line); color:var(--hi); font-size:16px; align-items:center; justify-content:center; }
.crumb-box{
  background:var(--panel-2); border:1px solid var(--line); border-radius:10px;
  padding:10px 18px; font-size:12.5px; font-weight:800; letter-spacing:0.02em; color:var(--hi);
}
.top-stats{ display:flex; align-items:center; gap:20px; }
.lvl-block{ display:flex; align-items:center; gap:9px; }
.lvl-star{ width:17px; height:17px; }
.lvl-text{ display:flex; flex-direction:column; gap:4px; }
.lvl-text .lbl{ font-size:11px; font-weight:800; }
.lvl-track{ width:96px; height:5px; border-radius:100px; background:var(--panel-3); overflow:hidden; }
.lvl-fill{ height:100%; background:linear-gradient(90deg, var(--gold), var(--gold-soft)); width:40%; transition:width .4s; }

.res-chip{ display:flex; align-items:center; gap:6px; font-family:'JetBrains Mono'; font-weight:700; font-size:13.5px; transition:transform .18s; }
.res-chip img{ width:19px; height:19px; }

.user-block{ display:flex; align-items:center; gap:10px; padding-left:14px; border-left:1px solid var(--line); }
.user-avatar{ width:38px; height:38px; border-radius:50%; object-fit:cover; border:2px solid var(--gold-soft); }
.user-meta{ line-height:1.25; }
.user-meta b{ display:block; font-size:12.5px; }
.user-meta span{ font-size:10px; color:var(--dim); }

.content{ flex:1; padding:30px 28px 60px; }
.content-grid{ display:grid; grid-template-columns:1fr 300px; gap:20px; align-items:start; }

.page-title{ font-size:34px; font-weight:800; margin-bottom:6px; }
.page-sub{ color:var(--magenta); font-weight:700; font-size:14px; margin-bottom:14px; }
.page-desc{ color:var(--mid); font-size:14px; line-height:1.7; max-width:640px; margin-bottom:22px; }

.panel{ background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:20px; }
.panel h3{ font-size:14px; font-weight:800; margin-bottom:14px; display:flex; align-items:center; gap:8px; }

.btn{ font-family:'Unbounded'; font-weight:600; font-size:13px; padding:13px 24px; border-radius:11px; cursor:pointer; border:none; display:inline-flex; align-items:center; gap:9px; transition:all .15s ease; }
.btn-primary{ background:linear-gradient(135deg, var(--violet), var(--magenta)); color:#160a2e; box-shadow:0 10px 26px -10px rgba(139,124,246,0.55); }
.btn-primary:hover{ transform:translateY(-2px); }
.btn-primary:disabled{ opacity:0.6; cursor:default; transform:none; }
.btn-ghost{ background:var(--panel-2); color:var(--hi); border:1px solid var(--line); }
.btn-ghost:hover{ border-color:var(--gold); color:var(--gold); }

/* character bubbles */
.cast-row{ display:flex; align-items:flex-end; gap:14px; margin:6px 0 20px; flex-wrap:wrap; }
.cast-figure{ position:relative; flex:none; text-align:center; }
.cast-avatar-img{ width:96px; height:96px; border-radius:50%; object-fit:cover; border:3px solid var(--panel-3); box-shadow:0 0 0 3px rgba(255,255,255,0.03); }
.cast-figure span.tag{ display:block; margin-top:6px; font-size:9.5px; color:var(--dim); font-weight:700; }
.bubble{
  background:var(--panel-2); border:1px solid var(--line); border-radius:14px; padding:12px 15px;
  font-size:12.5px; color:var(--hi); max-width:210px; position:relative; font-weight:600; line-height:1.5;
}
.bubble::after{
  content:''; position:absolute; bottom:-8px; left:24px; width:14px; height:14px;
  background:var(--panel-2); border-right:1px solid var(--line); border-bottom:1px solid var(--line);
  transform:rotate(45deg);
}

/* reactor image */
.reactor-wrap{ display:flex; justify-content:center; align-items:center; padding:10px 0 26px; }
.reactor-img{ width:100%; max-width:420px; border-radius:24px; box-shadow:0 30px 70px -20px rgba(139,124,246,0.35); animation:reactorGlow 3.4s ease-in-out infinite; }
@keyframes reactorGlow{ 0%,100%{ filter:brightness(1) saturate(1); } 50%{ filter:brightness(1.06) saturate(1.12); } }

/* checklist */
.checklist-box{ background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px 20px; max-width:460px; margin-bottom:16px; }
.checklist-box h5{ font-size:13px; font-weight:800; margin-bottom:12px; color:var(--sky); }
.checklist-box ul{ list-style:none; display:grid; gap:9px; margin-bottom:18px; }
.checklist-box li{ display:flex; align-items:center; gap:9px; font-size:12.5px; color:var(--mid); }
.checklist-box li .chk{ width:18px; height:18px; border-radius:5px; background:rgba(47,214,176,0.15); border:1px solid var(--teal); color:var(--teal); display:flex; align-items:center; justify-content:center; font-size:11px; flex:none; }

/* numbered info cards */
.info-col{ display:flex; flex-direction:column; gap:12px; }
.info-card{ background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:16px 16px 15px; position:relative; }
.info-num{ position:absolute; top:-9px; left:14px; width:24px; height:24px; border-radius:50%; background:var(--sky); color:#04162e; font-family:'JetBrains Mono'; font-weight:800; font-size:11.5px; display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 4px var(--void); }
.info-card h6{ font-size:12px; font-weight:800; margin:8px 0 7px; color:var(--gold-soft); letter-spacing:0.02em; }
.info-card .big-val{ font-family:'JetBrains Mono'; font-size:14px; color:var(--sky); font-weight:700; margin-bottom:6px; }
.info-card p{ font-size:11.5px; color:var(--mid); line-height:1.55; }
.info-card .eq{ margin-top:9px; font-family:'JetBrains Mono'; font-size:10.5px; color:var(--teal); background:var(--panel-3); border-radius:8px; padding:7px 9px; }

.bottom-row{ display:grid; grid-template-columns:1fr 1.3fr; gap:14px; margin-top:16px; }
.flow-card{ display:flex; align-items:center; justify-content:space-around; text-align:center; gap:6px; margin:12px 0; }
.flow-step{ font-size:22px; }
.flow-step + span{ display:block; font-size:10px; color:var(--dim); margin-top:4px; }
.flow-arrow{ color:var(--dim); font-size:16px; }
.fuel-icons{ display:flex; gap:18px; margin-top:10px; align-items:center; }
.fuel-atom{ display:flex; align-items:center; gap:6px; font-family:'JetBrains Mono'; font-size:12px; color:var(--hi); }
.fuel-dot{ width:18px; height:18px; border-radius:50%; }

/* dashboard */
.hero-dash{ display:grid; grid-template-columns:1.1fr 0.9fr; gap:28px; align-items:center; margin-bottom:40px; }
.hero-dash h1{ font-size:32px; font-weight:800; line-height:1.15; margin-bottom:12px; }
.hero-dash p{ color:var(--mid); font-size:14px; line-height:1.7; margin-bottom:20px; max-width:480px; }
.hero-cast{ display:flex; justify-content:center; gap:-10px; position:relative; }
.hero-cast img{ width:150px; height:150px; border-radius:50%; object-fit:cover; border:3px solid var(--panel-2); box-shadow:0 20px 50px -15px rgba(0,0,0,0.6); }
.hero-cast img:first-child{ margin-right:-24px; z-index:1; }

.cat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.cat-card{ background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px; cursor:pointer; transition:all .18s ease; display:block; }
.cat-card:hover{ transform:translateY(-3px); border-color:var(--accent,var(--gold)); }
.cat-ico{ width:40px; height:40px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:19px; margin-bottom:12px;
  background:rgba(255,255,255,0.07); border:1px solid var(--accent, var(--gold)); }
.cat-card h4{ font-family:'Unbounded'; font-size:13px; margin-bottom:5px; }
.cat-card p{ font-size:11px; color:var(--mid); line-height:1.5; margin-bottom:10px; }
.cat-meta{ display:flex; gap:10px; font-family:'JetBrains Mono'; font-size:10px; color:var(--dim); }
.cat-meta b{ color:var(--accent,var(--gold)); }
.cat-card.locked{ opacity:0.55; cursor:not-allowed; }
.cat-card.locked:hover{ transform:none; border-color:var(--line); }

/* quiz */
.quiz-panel{ background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:24px; }
.quiz-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.quiz-badge{ font-family:'JetBrains Mono'; font-size:11px; color:var(--gold); background:rgba(245,166,35,0.1); border:1px solid rgba(245,166,35,0.35); padding:5px 10px; border-radius:8px; }
.quiz-progress-track{ flex:1; height:6px; background:var(--panel-3); border-radius:100px; margin:0 16px; overflow:hidden; }
.quiz-progress-fill{ height:100%; width:0%; background:linear-gradient(90deg, var(--violet), var(--gold)); transition:width .4s ease; }
.quiz-q{ font-family:'Unbounded'; font-size:19px; font-weight:600; line-height:1.45; margin-bottom:22px; min-height:56px; }
.quiz-opts{ display:grid; gap:10px; margin-bottom:18px; }
.opt{ text-align:left; padding:14px 16px; border-radius:12px; border:1px solid var(--line); background:var(--panel-2); color:var(--hi); font-size:14px; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:12px; transition:all .15s ease; width:100%; }
.opt:hover{ border-color:var(--violet); background:var(--panel-3); }
.opt .k{ width:26px; height:26px; border-radius:50%; background:var(--panel-3); display:flex; align-items:center; justify-content:center; font-family:'JetBrains Mono'; font-size:12px; flex:none; }
.opt.correct{ border-color:var(--teal); background:rgba(47,214,176,0.12); }
.opt.correct .k{ background:var(--teal); color:#04241c; }
.opt.wrong{ border-color:var(--crimson,#f2495c); background:rgba(242,73,92,0.1); }
.opt.wrong .k{ background:#f2495c; color:#2a0407; }
.opt.disabled{ pointer-events:none; opacity:0.55; }
.opt.disabled.correct, .opt.disabled.wrong{ opacity:1; }
.check-btn{ background:var(--teal); color:#04241c; font-weight:800; font-family:'Unbounded'; font-size:12.5px; border:none; padding:12px 20px; border-radius:11px; display:flex; align-items:center; gap:8px; cursor:pointer; }
.quiz-feedback{ font-size:13px; font-weight:700; min-height:20px; margin-top:14px; }
.quiz-feedback.ok{ color:var(--teal); }
.quiz-feedback.bad{ color:#f2495c; }
.quiz-side{ display:flex; flex-direction:column; gap:14px; }
.side-panel{ background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px; }
.side-panel h5{ font-family:'JetBrains Mono'; font-size:10px; letter-spacing:0.1em; text-transform:uppercase; color:var(--dim); margin-bottom:12px; }
.streak-row{ display:flex; gap:6px; }
.streak-dot{ width:24px; height:24px; border-radius:7px; background:var(--panel-3); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:11px; transition:all .2s; }
.streak-dot.hit{ background:var(--gold); border-color:var(--gold); color:#1a1200; transform:scale(1.05); }
.reward-line{ display:flex; align-items:center; justify-content:space-between; font-size:12.5px; color:var(--mid); padding:7px 0; border-bottom:1px dashed var(--line); }
.reward-line b{ color:var(--gold); font-family:'JetBrains Mono'; }
.reward-line:last-child{ border-bottom:none; }

/* achievements */
.badge-strip{ display:grid; grid-template-columns:repeat(6,1fr); gap:12px; }
.badge-card{ background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:18px 12px; text-align:center; opacity:0.5; filter:grayscale(0.6); transition:all .2s; }
.badge-card.unlocked{ opacity:1; filter:none; border-color:var(--gold); box-shadow:0 0 0 1px rgba(245,166,35,0.15); }
.badge-ico{ font-size:28px; margin-bottom:8px; }
.badge-card h6{ font-family:'Unbounded'; font-size:11px; margin-bottom:4px; }
.badge-card span{ font-size:10px; color:var(--dim); }

.quote-bar{ margin-top:30px; background:var(--panel-2); border:1px solid var(--line); border-radius:14px; padding:14px 20px; text-align:center; font-size:13px; color:var(--mid); }
.quote-bar b{ color:var(--gold-soft); }

.nav-buttons{ display:flex; justify-content:space-between; margin-top:30px; }

.toast{
  position:fixed; top:20px; right:26px; z-index:200;
  background:var(--panel-2); border:1px solid var(--violet); border-radius:14px;
  padding:12px 18px; display:flex; align-items:center; gap:10px;
  font-family:'JetBrains Mono'; font-size:13px; font-weight:700; color:var(--gold-soft);
  box-shadow:0 20px 40px -14px rgba(0,0,0,0.6);
  transform:translateX(120%); opacity:0; transition:transform .35s ease, opacity .35s ease;
}
.toast.show{ transform:translateX(0); opacity:1; }

.overlay{ position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:70; opacity:0; pointer-events:none; transition:opacity .25s ease; }
.overlay.show{ opacity:1; pointer-events:auto; }

/* ===================== ВИДЕО ===================== */
.video-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:26px 0 30px; }
.video-card{ background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:14px; }
.video-card h5{ font-size:12.5px; font-weight:800; margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.video-card .tagline{ font-size:11px; color:var(--dim); margin-top:8px; line-height:1.5; }
/* Классический "padding-top hack" вместо aspect-ratio — работает даже в старых браузерах */
.video-frame{
  position:relative; border-radius:14px; overflow:hidden; background:#000;
  width:100%; max-width:260px; margin:0 auto;
  height:0; padding-top:177.78%; /* 9:16 = 16/9*100 */
}
.video-frame video{ position:absolute; left:0; top:0; width:100%; height:100%; display:block; object-fit:contain; background:#000; }
.play-badge{ position:absolute; top:10px; left:10px; z-index:2; background:rgba(0,0,0,0.6); border:1px solid rgba(255,255,255,0.2); color:#fff; font-family:'JetBrains Mono'; font-size:10px; padding:4px 9px; border-radius:100px; display:flex; align-items:center; gap:5px; pointer-events:none; }
@media (max-width: 560px){ .video-grid{ grid-template-columns:1fr; } .video-frame{ max-width:220px; } }

/* ===================== DRAG & DROP ИГРА — крупные плитки-иконки ===================== */
.game-shell{ background:var(--panel); border:1px solid var(--line); border-radius:20px; padding:22px 24px; position:relative; overflow:hidden; }
.game-hud{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.game-hud-item{ display:flex; align-items:center; gap:8px; font-family:'JetBrains Mono'; font-size:12.5px; font-weight:700; }
.timer-track{ width:150px; height:8px; border-radius:100px; background:var(--panel-3); overflow:hidden; }
.timer-fill{ height:100%; background:linear-gradient(90deg, var(--teal), var(--sky)); width:100%; transition:width 1s linear, background .3s ease; }
.timer-fill.danger{ background:linear-gradient(90deg, #f2495c, var(--gold)); animation:timerPulse .6s ease-in-out infinite; }
@keyframes timerPulse{ 0%,100%{ opacity:1; } 50%{ opacity:0.55; } }
.combo-badge{ background:rgba(245,166,35,0.15); border:1px solid var(--gold); color:var(--gold-soft); padding:5px 12px; border-radius:100px; }

.game-board{ display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.tray-label, .slots-label{ font-size:11px; letter-spacing:0.1em; color:var(--dim); margin-bottom:12px; text-transform:uppercase; font-weight:700; }

.icon-tray{ display:flex; flex-wrap:wrap; gap:14px; align-content:flex-start; min-height:240px; padding:14px; border-radius:16px; background:rgba(255,255,255,0.02); border:1px dashed var(--line); }

.icon-tile{
  width:92px; height:92px; border-radius:20px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  cursor:grab; user-select:none; touch-action:none; position:relative;
  background:linear-gradient(160deg, var(--panel-3), var(--panel-2));
  border:2px solid var(--line);
  box-shadow:0 10px 24px -10px rgba(0,0,0,0.65);
  animation:floaty 3.2s ease-in-out infinite;
}
.icon-tile:active{ cursor:grabbing; }
.icon-tile .emoji{ font-size:36px; line-height:1; filter:drop-shadow(0 4px 6px rgba(0,0,0,0.45)); }
.icon-tile .tag{ font-size:8.5px; font-weight:800; color:var(--mid); text-align:center; letter-spacing:0.02em; padding:0 4px; }
.icon-tile.dragging{ opacity:0.2; animation:none; }
.icon-tile.selected{ border-color:var(--gold); box-shadow:0 0 0 4px rgba(245,166,35,0.28), 0 12px 26px -8px rgba(245,166,35,0.55); transform:scale(1.08); animation:none; }
.icon-tile.floating-clone{ position:fixed; z-index:999; pointer-events:none; animation:none; box-shadow:0 24px 50px -12px rgba(139,124,246,0.7); border-color:var(--violet); transform:scale(1.08) rotate(-3deg); }
@keyframes floaty{ 0%,100%{ transform:translateY(0px) rotate(-1deg); } 50%{ transform:translateY(-7px) rotate(1deg); } }

.icon-slots{ display:flex; flex-direction:column; gap:12px; }
.icon-slot{
  position:relative; border:2px dashed var(--line); border-radius:18px;
  min-height:88px; display:flex; align-items:center; gap:14px; padding:12px 16px 12px 44px;
  background:var(--panel-2); transition:all .18s ease; cursor:pointer;
}
.icon-slot.awaiting{ border-color:var(--gold); box-shadow:0 0 0 3px rgba(245,166,35,0.18); }
.icon-slot .slot-num{ position:absolute; left:10px; top:10px; width:22px; height:22px; border-radius:50%; background:var(--panel-3); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-family:'JetBrains Mono'; font-size:10px; font-weight:800; color:var(--mid); }
.icon-slot .ghost{ width:54px; height:54px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:26px; background:var(--panel-3); opacity:0.3; flex:none; transition:all .3s cubic-bezier(.34,1.56,.64,1); filter:grayscale(1); }
.icon-slot .slot-text{ flex:1; min-width:0; }
.icon-slot .slot-text b{ display:block; font-family:'Unbounded'; font-size:11.5px; color:var(--gold-soft); margin-bottom:3px; letter-spacing:0.01em; }
.icon-slot .slot-text span{ font-size:11px; color:var(--dim); line-height:1.4; display:block; }
.icon-slot.over{ border-color:var(--violet); background:rgba(139,124,246,0.12); transform:scale(1.02); }
.icon-slot.correct{ border-style:solid; border-color:var(--teal); background:rgba(47,214,176,0.1); }
.icon-slot.correct .ghost{ opacity:1; filter:none; background:linear-gradient(160deg, var(--teal), #1a8f74); box-shadow:0 0 0 4px rgba(47,214,176,0.22), 0 10px 22px -8px rgba(47,214,176,0.65); transform:scale(1.12); }
.icon-slot.correct .slot-num{ background:var(--teal); color:#04241c; border-color:var(--teal); }
.icon-slot.shake{ animation:shakeSlot .4s ease; border-color:#f2495c; }
@keyframes shakeSlot{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-9px); } 40%{ transform:translateX(8px); } 60%{ transform:translateX(-6px); } 80%{ transform:translateX(4px); } }

.game-shell.shake-screen{ animation:shakeScreen .35s ease; }
@keyframes shakeScreen{ 0%,100%{ transform:translateX(0); } 25%{ transform:translateX(-6px); } 50%{ transform:translateX(6px); } 75%{ transform:translateX(-4px); } }

.particle{ position:fixed; z-index:999; pointer-events:none; font-size:20px; animation:particleFly 0.9s ease-out forwards; }
@keyframes particleFly{ 0%{ transform:translate(0,0) scale(1); opacity:1; } 100%{ transform:translate(var(--dx), var(--dy)) scale(0.4); opacity:0; } }

.victory-overlay{ position:fixed; inset:0; background:rgba(4,5,15,0.9); z-index:1000; display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .3s ease; padding:20px; }
.victory-overlay.show{ opacity:1; pointer-events:auto; }
.victory-card{ background:var(--panel); border:1px solid var(--gold); border-radius:24px; padding:40px 44px; text-align:center; max-width:380px; width:100%; transform:scale(0.85); transition:transform .3s ease; box-shadow:0 40px 100px -20px rgba(245,166,35,0.3); }
.victory-overlay.show .victory-card{ transform:scale(1); }
.victory-card .big-emoji{ font-size:52px; margin-bottom:10px; }
.victory-card h2{ font-size:24px; margin-bottom:8px; }
.victory-card p{ color:var(--mid); font-size:13px; margin-bottom:20px; }
.victory-stats{ display:flex; justify-content:center; gap:22px; margin-bottom:24px; }
.victory-stats div b{ display:block; font-family:'JetBrains Mono'; font-size:20px; color:var(--gold); }
.victory-stats div span{ font-size:10px; color:var(--dim); text-transform:uppercase; letter-spacing:0.06em; }

@media (max-width: 900px){ .game-board{ grid-template-columns:1fr; } .icon-tray{ min-height:auto; } }

/* ===================== НАСТРОЙКИ ===================== */
.setting-row{ display:flex; align-items:center; justify-content:space-between; padding:16px 4px; border-bottom:1px solid var(--line); gap:16px; }
.setting-row:last-child{ border-bottom:none; }
.setting-info b{ display:block; font-size:13px; margin-bottom:3px; }
.setting-info span{ font-size:11.5px; color:var(--dim); }
.switch{ position:relative; width:46px; height:26px; flex:none; }
.switch input{ opacity:0; width:0; height:0; }
.switch-track{ position:absolute; inset:0; background:var(--panel-3); border:1px solid var(--line); border-radius:100px; cursor:pointer; transition:all .2s ease; }
.switch-track::before{ content:''; position:absolute; width:18px; height:18px; left:3px; top:2px; background:var(--mid); border-radius:50%; transition:all .2s ease; }
.switch input:checked + .switch-track{ background:linear-gradient(90deg, var(--violet), var(--magenta)); border-color:transparent; }
.switch input:checked + .switch-track::before{ transform:translateX(20px); background:#fff; }
.seg-control{ display:flex; gap:6px; background:var(--panel-3); border-radius:10px; padding:4px; }
.seg-btn{ padding:7px 14px; border-radius:7px; border:none; background:transparent; color:var(--mid); font-size:11.5px; font-weight:700; cursor:pointer; }
.seg-btn.active{ background:var(--panel-2); color:var(--hi); box-shadow:0 4px 10px -4px rgba(0,0,0,0.5); }
.danger-btn{ background:rgba(242,73,92,0.12); border:1px solid rgba(242,73,92,0.4); color:#f2495c; }
.danger-btn:hover{ background:rgba(242,73,92,0.2); }

/* ===================== ХАБ УРОКОВ ===================== */
.lesson-row{ display:flex; align-items:center; gap:16px; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:14px 18px; margin-bottom:10px; }
.lesson-row .lr-ico{ width:42px; height:42px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:19px; flex:none; background:rgba(255,255,255,0.07); border:1px solid var(--accent, var(--gold)); }
.lesson-row .lr-body{ flex:1; min-width:0; }
.lesson-row .lr-body b{ font-size:13px; display:block; margin-bottom:3px; }
.lesson-row .lr-body span{ font-size:11px; color:var(--dim); }
.lesson-row .lr-progress{ width:110px; flex:none; }
.lesson-row .lr-track{ height:6px; border-radius:100px; background:var(--panel-3); overflow:hidden; margin-bottom:4px; }
.lesson-row .lr-fill{ height:100%; background:linear-gradient(90deg, var(--sky), var(--violet)); }
.lesson-row .lr-pct{ font-family:'JetBrains Mono'; font-size:10px; color:var(--dim); }

@media (max-width: 1080px){
  .content-grid{ grid-template-columns:1fr; }
  .cat-grid{ grid-template-columns:repeat(2,1fr); }
  .bottom-row{ grid-template-columns:1fr; }
  .badge-strip{ grid-template-columns:repeat(3,1fr); }
  .hero-dash{ grid-template-columns:1fr; }
}
@media (max-width: 780px){
  .sidebar{ position:fixed; left:0; top:0; transform:translateX(-105%); transition:transform .28s ease; }
  .sidebar.show{ transform:translateX(0); }
  .mobile-menu-btn{ display:flex; }
  .cat-grid{ grid-template-columns:1fr; }
  .top-stats{ gap:10px; }
  .crumb-box{ display:none; }
}
