*{box-sizing:border-box} :root{--bg:#f5f7fb;--card:#fff;--text:#182238;--muted:#6d788c;--line:#dfe4ee;--accent:#5b63f6;--accent2:#7b5cff;--good:#169b6b;--bad:#d94c5b;--shadow:0 10px 32px rgba(30,42,72,.08)}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
.top{height:66px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 24px;position:sticky;top:0;z-index:20}
.logo{font-size:21px;font-weight:900;text-decoration:none;color:var(--text)}.logo span{color:var(--accent);font-weight:700}
.mobile-menu{display:none;margin-left:auto;border:0;background:#eef0ff;padding:10px;border-radius:10px;font-size:20px}
.layout{display:grid;grid-template-columns:270px 1fr;min-height:calc(100vh - 66px)}
.sidebar{background:#fff;border-right:1px solid var(--line);padding:20px 12px;position:sticky;top:66px;height:calc(100vh - 66px);overflow:auto}
.side-title{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted);font-weight:900;padding:0 12px 10px}
.nav{display:block;text-decoration:none;color:#465168;border-radius:10px;padding:9px 12px;margin:2px 0;font-weight:650}.nav:hover{background:#f0f2fa}.nav.home{font-weight:850}.nav.sub{font-size:14px;padding-left:29px}
.group-title{font-size:13px;font-weight:900;padding:15px 12px 6px;color:#27324a}
.content{padding:30px;max-width:1280px;width:100%;margin:auto}
.hero{border-radius:25px;padding:40px;background:linear-gradient(135deg,#5963f4,#8158dc);color:#fff;box-shadow:var(--shadow);margin-bottom:22px}
.hero h1{font-size:42px;margin:5px 0 10px}.hero p{font-size:18px;max-width:750px;opacity:.9}
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.menu-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px;text-decoration:none;color:var(--text);box-shadow:var(--shadow);transition:.15s}.menu-card:hover{transform:translateY(-2px);border-color:#aab0ff}.icon{font-size:30px}.menu-card h3{margin:9px 0 5px}.menu-card p{margin:0;color:var(--muted);font-size:14px}
.card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:25px;box-shadow:var(--shadow)}
.head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:20px}.head h2{margin:0 0 6px}.muted{color:var(--muted)}
.btn{border:0;border-radius:11px;background:var(--accent);color:#fff;font-weight:850;padding:11px 16px;cursor:pointer}.btn.gray{background:#edf0f6;color:#28334b}.actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}
.boards{display:grid;grid-template-columns:1fr 1fr;gap:22px}.board-title{font-weight:850;margin-bottom:9px}
.grid{display:grid;grid-template-columns:repeat(10,1fr);aspect-ratio:1;border:1px solid #bac3d3;background:#fff;touch-action:none}.cell{border-right:1px solid #e5e8ef;border-bottom:1px solid #e5e8ef;cursor:crosshair}.cell.on{background:#20294a}.sample .cell.on{background:#6872ff}
.feedback{margin-top:12px;padding:12px 14px;border-radius:11px;font-weight:750}.feedback.good{background:#e7f8f0;color:#08784d}.feedback.bad{background:#ffeaed;color:#a52638}
.choices{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.choice{border:2px solid var(--line);border-radius:17px;padding:15px;cursor:pointer;background:#fff}.choice.selected{border-color:var(--accent);background:#f2f3ff}
.linebox{height:160px;background:#fafbfe;border-radius:12px;position:relative;overflow:hidden;margin-top:10px}.linebox i{position:absolute;width:130%;height:5px;background:#25304a;left:-15%;top:50%}
.axioms{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.axiom{border:1px solid var(--line);border-radius:15px;padding:16px;background:#fff}.axiom h3{margin:0 0 7px}.task{margin-top:18px;background:#f7f8fc;border-radius:16px;padding:18px}
.build{display:grid;grid-template-columns:minmax(0,650px) 300px;gap:22px}
.math{text-align:center;font-size:35px;padding:18px}.number{font-size:20px;width:100px;padding:10px;border:1px solid var(--line);border-radius:10px}
.notice{padding:20px;border-radius:16px;background:#f0f2ff;border:1px solid #d9dcff}
@media(max-width:900px){.layout{grid-template-columns:1fr}.sidebar{position:fixed;left:-290px;top:66px;width:270px;z-index:15;transition:.2s}.sidebar.open{left:0}.mobile-menu{display:block}.content{padding:18px}.cards,.axioms,.choices{grid-template-columns:1fr}.boards,.build{grid-template-columns:1fr}.hero h1{font-size:32px}}

.task-toolbar{display:flex;justify-content:space-between;align-items:center;margin:10px 0 14px}.task-row{display:flex;gap:12px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:7px 0;background:#fff}.task-num{min-width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#eef0ff;color:#4f59e8;font-weight:900}

.task-progress{font-weight:900;color:var(--accent);margin:0 0 14px}.task-active{background:#f8f9fd}.task-active .grid{max-width:650px;margin-top:14px}.task-toolbar{display:flex;justify-content:space-between;align-items:center}.task-row{display:flex;gap:12px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:12px;margin:7px 0}.task-num{min-width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#eef0ff;color:#4f59e8;font-weight:900}

.axiom-board-wrap{margin-top:14px}.axiom-canvas{display:block;width:100%;max-width:600px;height:auto;border:1px solid var(--line);border-radius:12px;background:#fff;touch-action:none}.axiom-help{margin:8px 0 0}.task-active h3{font-size:18px}

.axiom-theory{background:#eef1ff;border:1px solid #d9defc;border-radius:12px;padding:12px 14px;margin:12px 0 16px;line-height:1.5}.axiom-boards{align-items:start}.axiom-boards>div{min-width:0}.axiom-boards .grid{width:min(100%,520px);aspect-ratio:1/1}.grid{position:relative;display:grid;grid-template-columns:repeat(10,1fr);grid-template-rows:repeat(10,1fr);touch-action:none;user-select:none}.cell{border:1px solid #e4e8f1;background:#fff;min-width:0;min-height:0}.cell.on{background:#4f59e8}.cell.given{background:#dfe4ff}.grid-label{position:absolute;z-index:3;font-weight:900;color:#20294a;pointer-events:none;font-size:14px}.sample .cell{pointer-events:none}.sample .cell.given{background:#cbd3ff}

/* Координатная разметка 20×20: сверху 1–20, слева А–Т */
.grid-wrap{
  display:inline-block;
  max-width:100%;
  overflow:auto;
  padding:8px 8px 10px 8px;
  background:#fff;
  border-radius:12px;
}
.grid-col-labels{
  display:grid;
  grid-template-columns:28px repeat(10,minmax(22px,1fr));
  width:100%;
  min-width:488px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#596273;
  user-select:none;
  margin-bottom:4px;
}
.grid-col-labels>div{
  min-height:20px;
  display:grid;
  place-items:center;
}
.grid-corner{visibility:hidden}
.grid-body{
  display:grid;
  grid-template-columns:28px 1fr;
  align-items:stretch;
}
.grid-row-labels{
  display:grid;
  grid-template-rows:repeat(10,1fr);
  min-height:440px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#596273;
  user-select:none;
}
.grid-row-labels>div{
  display:grid;
  place-items:center;
}
.grid-body>.grid{
  min-width:440px;
  min-height:440px;
  width:440px;
  height:440px;
}
.grid-body>.grid .cell{
  min-width:0;
  min-height:0;
}
@media(max-width:700px){
  .grid-wrap{max-width:100%;overflow-x:auto}
}

/* Координаты непосредственно по сторонам каждого поля 20×20 */
.grid-wrap{display:block;width:100%;max-width:560px;overflow-x:auto;padding:6px 8px 10px;background:#fff;border-radius:10px;box-sizing:border-box}
.grid-col-labels{display:grid;grid-template-columns:30px repeat(10,22px);width:max-content;min-width:470px;height:24px;margin-left:0}
.grid-col-labels>div{display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;color:#566176}
.grid-col-labels .grid-corner{width:30px}
.grid-body{display:grid;grid-template-columns:30px max-content;align-items:stretch}
.grid-row-labels{display:grid;grid-template-rows:repeat(10,22px);width:30px}
.grid-row-labels>div{display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;color:#566176}
.grid-body>.grid{width:440px;height:440px;min-width:440px;min-height:440px;aspect-ratio:auto}
@media(max-width:700px){
 .boards{grid-template-columns:1fr}
 .grid-wrap{max-width:100%}
}

/* V10: координаты полей 20×20 */
.grid-wrap{display:inline-block;max-width:100%;overflow:auto;padding:8px;background:#fff;border-radius:12px}
.grid-col-labels{display:grid;grid-template-columns:28px repeat(10,22px);width:468px;text-align:center;font-size:11px;font-weight:800;color:#566074;user-select:none;margin-bottom:3px}
.grid-col-labels>div{height:20px;display:grid;place-items:center}
.grid-corner{visibility:hidden}
.grid-body{display:grid;grid-template-columns:28px 440px;align-items:stretch}
.grid-row-labels{display:grid;grid-template-rows:repeat(10,22px);height:440px;text-align:center;font-size:11px;font-weight:800;color:#566074;user-select:none}
.grid-row-labels>div{display:grid;place-items:center}
.grid-body>.grid{width:440px;height:440px;min-width:440px;min-height:440px}
.grid-body>.grid .cell{min-width:0;min-height:0}

/* V11: надёжное рисование по клеткам */
.grid{touch-action:none;user-select:none;-webkit-user-select:none}
.grid .cell{cursor:crosshair;touch-action:none}
.grid-wrap{user-select:none;-webkit-user-select:none}

.hint-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0}
.hint-note{font-size:12px;color:#687386}
.hint-btn{background:#fff3b0;border-color:#f1d65a;color:#6d5700}
.cell.hint-cell{background:#ffd83d!important;box-shadow:inset 0 0 0 1px #d5ad00}
.cell.hint-cell.on{background:#ffd83d!important}
.axiom-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.axiom-statement{background:#eef1ff;border:1px solid #d9defd;padding:12px 14px;border-radius:10px;margin:10px 0 14px}
.axiom-modal{position:fixed;inset:0;background:rgba(20,27,45,.55);display:flex;align-items:center;justify-content:center;padding:20px;z-index:999999}
.axiom-modal-card{position:relative;width:min(620px,100%);background:#fff;border-radius:18px;padding:28px;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.axiom-modal-close{position:absolute;right:12px;top:10px;border:0;background:#f1f3f8;border-radius:50%;width:34px;height:34px;font-size:22px;cursor:pointer}
.axiom-modal-title{font-size:22px;font-weight:900;margin-bottom:14px}
.axiom-modal-text{font-size:16px;line-height:1.6}
@media(max-width:800px){.axiom-head{flex-direction:column}.axiom-fields{grid-template-columns:1fr!important}}

.cell.given-cell{background:#b9c7ff!important;box-shadow:inset 0 0 0 1px #8298ee}
.feedback.hint{background:#fff7cf;border:1px solid #f1d76b;padding:10px;border-radius:10px}

/* V15: исходные точки A/B и клеточная прямая */
.given-cell{background:#a9b8ff!important;box-shadow:inset 0 0 0 1px #6f84e8}
.hint-cell{background:#ffd43b!important;box-shadow:inset 0 0 0 1px #d1a900}

/* V17 — универсальный тренажёр фигур и линий */
.shape-fields{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:12px}
.shape-fields>div{min-width:0}
.shape-fields h4{margin:0 0 8px}
.shape-fields .grid-wrap{width:100%}
.given-cell{background:#b8c7ff!important;box-shadow:inset 0 0 0 1px #8298ee}
.hint-cell{background:#ffd43b!important;box-shadow:inset 0 0 0 1px #d1a900}
@media(max-width:900px){.shape-fields{grid-template-columns:1fr}}

/* V23 — мобильная версия и рисование пальцем */
html,body{max-width:100%;overflow-x:hidden}
body.menu-open{overflow:hidden}
.content{min-width:0}
.grid-wrap{width:100%;max-width:560px;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.grid-col-labels{width:100%;min-width:0;grid-template-columns:28px repeat(10,minmax(0,1fr))}
.grid-body{grid-template-columns:28px minmax(0,1fr)}
.grid-body>.grid{width:100%;height:auto;aspect-ratio:1/1;min-width:0;min-height:0}
.grid-row-labels{height:auto;min-height:0;grid-template-rows:repeat(10,1fr)}
.grid,.cell{touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.cell{cursor:pointer}
.axiom-boards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.axiom-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.axiom-fields>div,.axiom-boards>div{min-width:0}
.actions .btn{min-height:44px}
.btn{min-height:44px}
.mobile-menu{touch-action:manipulation}
@media(max-width:700px){
  .top{height:58px;padding:0 12px}
  .logo{font-size:17px}
  .mobile-menu{display:block;padding:8px 11px;margin-left:auto}
  .sidebar{top:58px;height:calc(100dvh - 58px);padding:14px 10px}
  .layout{min-height:calc(100dvh - 58px)}
  .content{padding:10px 8px 24px}
  .card{padding:14px;border-radius:16px}
  .hero{padding:22px 16px;border-radius:18px}
  .hero h1{font-size:28px;line-height:1.1}
  .hero p{font-size:15px}
  .cards{gap:10px}
  .menu-card{padding:15px;border-radius:15px}
  .menu-card h3{font-size:17px}
  .head{flex-direction:column;gap:10px}
  .head .btn{align-self:flex-start}
  .boards,.build,.axiom-fields,.axiom-boards{grid-template-columns:1fr}
  .boards>div,.axiom-fields>div,.axiom-boards>div{width:100%}
  .grid-wrap{max-width:100%;padding:4px 4px 7px}
  .grid-col-labels{grid-template-columns:24px repeat(10,minmax(0,1fr));font-size:9px}
  .grid-col-labels>div{height:18px}
  .grid-body{grid-template-columns:24px minmax(0,1fr)}
  .grid-row-labels{font-size:9px}
  .task{padding:12px;border-radius:13px}
  .task-active .grid{max-width:100%}
  .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .actions .btn{width:100%;padding:10px 8px;font-size:14px}
  .actions .btn:last-child{grid-column:1/-1}
  .hint-bar{align-items:stretch}
  .hint-btn{width:100%}
  .hint-note{font-size:11px}
  .axiom-head{flex-direction:column}
  .axiom-head .btn{width:100%}
  .axiom-modal-card{padding:22px 18px}
  .axiom-modal-text{font-size:15px}
}
@media(max-width:380px){
  .logo span{display:none}
  .content{padding-left:5px;padding-right:5px}
  .grid-col-labels{grid-template-columns:21px repeat(10,minmax(0,1fr));font-size:8px}
  .grid-body{grid-template-columns:21px minmax(0,1fr)}
  .grid-wrap{padding-left:2px;padding-right:2px}
}

/* V24 — надёжная мобильная кнопка меню */
.mobile-menu{
  position:relative;
  z-index:1001;
  pointer-events:auto;
  -webkit-tap-highlight-color:transparent;
  cursor:pointer;
  min-width:44px;
  min-height:44px;
  display:none;
}
@media(max-width:900px){
  .mobile-menu{
    display:flex !important;
    align-items:center;
    justify-content:center;
    position:fixed;
    top:7px;
    right:10px;
    width:46px;
    height:46px;
    margin:0 !important;
    padding:0 !important;
    z-index:10001;
    background:#eef0ff;
    border:1px solid #d9ddff;
    color:#25345b;
    border-radius:12px;
    font-size:25px;
    line-height:1;
    box-shadow:0 3px 12px rgba(20,35,70,.12);
    touch-action:manipulation;
  }
  .mobile-menu:active{
    transform:scale(.96);
  }
  .top{
    position:relative;
    z-index:1000;
  }
  .sidebar{
    z-index:10000 !important;
  }
}

/* V25 — гарантированно видимая мобильная панель */
@media (max-width: 900px){
  .sidebar{
    position:fixed !important;
    top:58px !important;
    left:-310px !important;
    bottom:0 !important;
    width:290px !important;
    height:auto !important;
    max-height:calc(100dvh - 58px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    z-index:99999 !important;
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    background:#fff !important;
    box-shadow:8px 0 28px rgba(20,30,60,.18);
    transition:left .22s ease !important;
  }
  .sidebar.open{
    left:0 !important;
  }
}
@media (max-width:380px){
  .sidebar{
    width:calc(100vw - 38px) !important;
    left:calc(-100vw + 38px) !important;
  }
  .sidebar.open{left:0 !important}
}


/* V26 — единая геометрия координатной сетки + Android-safe mobile layout */
.grid-wrap{
  --row-label:28px;
  width:100%;
  max-width:560px;
  display:block;
  overflow-x:auto;
  overflow-y:hidden;
  padding:8px;
  background:#fff;
  border-radius:12px;
  box-sizing:border-box;
  -webkit-overflow-scrolling:touch;
}
.grid-col-labels{
  width:100%;
  min-width:0;
  height:24px;
  display:grid;
  grid-template-columns:var(--row-label) repeat(10,minmax(0,1fr));
  margin:0 0 3px;
  text-align:center;
  font-size:11px;
  font-weight:900;
  color:#566176;
  user-select:none;
}
.grid-col-labels>div{
  width:auto;
  height:24px;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.grid-col-labels .grid-corner{width:auto}
.grid-body{
  width:100%;
  display:grid;
  grid-template-columns:var(--row-label) minmax(0,1fr);
  align-items:stretch;
}
.grid-row-labels{
  width:var(--row-label);
  height:auto;
  min-height:0;
  display:grid;
  grid-template-rows:repeat(10,minmax(0,1fr));
  text-align:center;
  font-size:11px;
  font-weight:900;
  color:#566176;
  user-select:none;
}
.grid-row-labels>div{
  width:100%;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.grid-body>.grid{
  width:100%;
  min-width:0;
  min-height:0;
  height:auto;
  aspect-ratio:1/1;
}

/* Android: не используем только dvh, даём обычный vh как совместимый fallback. */
@media(max-width:900px){
  .sidebar{
    height:calc(100vh - 58px) !important;
    max-height:calc(100vh - 58px) !important;
  }
  .layout{min-height:calc(100vh - 58px)}
}
@media(max-width:700px){
  .grid-wrap{max-width:100%;padding:4px}
  .grid-wrap{--row-label:24px}
  .grid-col-labels,.grid-col-labels>div{height:18px}
  .grid-col-labels{font-size:9px}
  .grid-row-labels{font-size:9px}
}
@media(max-width:380px){
  .grid-wrap{--row-label:21px;padding-left:2px;padding-right:2px}
  .grid-col-labels{font-size:8px}
  .grid-row-labels{font-size:8px}
}


/* V28 — поле 10×10, крупные клетки, выбор строго по одной клетке */
.grid-wrap{width:100%;max-width:620px;overflow:hidden;padding:8px;background:#fff;border-radius:12px;box-sizing:border-box}
.grid-col-labels{width:100%;min-width:0;grid-template-columns:34px repeat(10,minmax(0,1fr));font-size:13px}
.grid-body{grid-template-columns:34px minmax(0,1fr)}
.grid-row-labels{grid-template-rows:repeat(10,minmax(0,1fr));font-size:13px}
.grid-body>.grid{width:100%;height:auto;min-width:0;min-height:0;aspect-ratio:1/1}
.grid{grid-template-columns:repeat(10,1fr)!important;grid-template-rows:repeat(10,1fr)!important;touch-action:manipulation!important}
.cell{touch-action:manipulation!important;cursor:pointer;min-width:0;min-height:0}
.grid-help{margin:5px 0 0;font-size:12px;color:#687386}
@media(max-width:700px){
 .grid-wrap{max-width:100%;padding:5px}
 .grid-col-labels{grid-template-columns:30px repeat(10,minmax(0,1fr));font-size:11px}
 .grid-body{grid-template-columns:30px minmax(0,1fr)}
 .grid-row-labels{font-size:11px}
 .grid-col-labels>div{height:24px}
 .cell{min-height:30px}
}
@media(max-width:380px){
 .grid-col-labels{grid-template-columns:26px repeat(10,minmax(0,1fr));font-size:10px}
 .grid-body{grid-template-columns:26px minmax(0,1fr)}
 .grid-row-labels{font-size:10px}
}


/* Аксиома 11: общая вершина двух лучей */
.cell.vertex-cell{
  background:#35b86b !important;
  box-shadow:inset 0 0 0 2px #198a4a !important;
  position:relative;
  z-index:2;
}
.cell.vertex-cell::after{
  content:'O';
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:11px;
  font-weight:900;
  pointer-events:none;
}

.cell.fixed-cell{cursor:default!important;touch-action:none;}

/* V31 — три состояния клетки для аксиом */
.cell.state-blue{background:#4f63ff!important;box-shadow:inset 0 0 0 1px #3448d7;}
.cell.state-green{background:#35c979!important;box-shadow:inset 0 0 0 1px #1a9b59;}
.cell.hint-blue{background:#4f63ff!important;box-shadow:inset 0 0 0 3px #ffe45c;}
.cell.hint-green{background:#35c979!important;box-shadow:inset 0 0 0 3px #ffe45c;}
.cell.given-state-blue{background:#9eafff!important;box-shadow:inset 0 0 0 2px #5268ef;}
.cell.given-state-green{background:#8ce8b5!important;box-shadow:inset 0 0 0 2px #32ad68;}
.axiom-intro{background:#fffdf0;border:1px solid #f0df88;border-radius:12px;padding:12px 14px;margin:12px 0 16px;line-height:1.65;color:#384052;}
.axiom-intro .legend-blue{color:#3048d9;font-weight:800;}
.axiom-intro .legend-green{color:#138b4c;font-weight:800;}
.axiom-intro .legend-erase{color:#7a5360;font-weight:800;}
@media(max-width:700px){
 .axiom-intro{font-size:14px;padding:11px 12px;}
 .axiom-fields{grid-template-columns:1fr!important;}
}

/* =========================================================
   V32 — обновлённый дизайн + дружелюбная мобильная версия
   ========================================================= */
:root{
  --accent:#5567e8;
  --accent2:#7c5ce2;
  --soft:#eef2ff;
  --orange:#ff9d37;
  --cyan:#3eb7c7;
}
body{
  background:
    radial-gradient(circle at 8% 0%,rgba(124,92,226,.08),transparent 28%),
    radial-gradient(circle at 100% 12%,rgba(62,183,199,.08),transparent 24%),
    var(--bg);
}
.top{box-shadow:0 4px 18px rgba(39,53,92,.05)}
.sidebar{scrollbar-width:thin;scrollbar-color:#cdd3ea transparent}
.group-title{margin-top:4px;border-top:1px solid #eef1f6;padding-top:17px}
.nav{transition:background .15s,color .15s,transform .15s}
.nav:hover{transform:translateX(2px)}
.nav.active{background:linear-gradient(135deg,#eef0ff,#f4f1ff);color:#4052cf;box-shadow:inset 3px 0 0 var(--accent)}
.nav.home.active{font-weight:900}

.hero{
  background:
    radial-gradient(circle at 90% 15%,rgba(255,255,255,.22),transparent 25%),
    linear-gradient(135deg,#5267e8,#7858db 58%,#4faabd);
  position:relative;
  overflow:hidden;
}
.hero:after{content:"△  ○  □  ∠";position:absolute;right:26px;bottom:12px;font-size:56px;font-weight:900;letter-spacing:10px;color:rgba(255,255,255,.10);pointer-events:none}
.cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.menu-card{min-height:150px;position:relative;overflow:hidden}
.menu-card:after{content:"";position:absolute;width:90px;height:90px;border-radius:50%;right:-38px;bottom:-42px;background:linear-gradient(135deg,rgba(85,103,232,.10),rgba(62,183,199,.10))}
.menu-card .icon{filter:drop-shadow(0 5px 10px rgba(60,70,120,.14))}

/* Строительные задания */
.task-active{border:1px solid #e7eaf4}
.grid-help{background:#eef5ff;border:1px solid #d9e7ff;color:#52647b;padding:9px 11px;border-radius:10px;font-size:12px}
.shape-fields h4{font-size:13px;color:#556175;text-transform:uppercase;letter-spacing:.05em}
.cell{transition:background .06s,transform .06s}
.cell.on{box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}
.cell:active{transform:scale(.93)}

/* Quiz */
.quiz-shell{max-width:940px;margin:0 auto}
.quiz-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:2px 0 8px}
.quiz-score{font-size:14px;background:#fff8df;color:#785c06;border:1px solid #f2dda0;padding:7px 10px;border-radius:999px;white-space:nowrap}
.quiz-progress{height:8px;background:#edf0f5;border-radius:999px;overflow:hidden;margin-bottom:16px}
.quiz-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#5869ea,#8a5fe5,#3fb6c5);transition:width .2s}
.quiz-card{background:linear-gradient(180deg,#fafbff,#fff);border:1px solid #e4e8f4;border-radius:20px;padding:22px}
.quiz-tag{display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border-radius:999px;background:#edf0ff;color:#5360cf;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.quiz-card h3{font-size:25px;line-height:1.25;margin:13px 0 18px;max-width:780px}
.quiz-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.quiz-choice{display:flex;align-items:center;gap:11px;width:100%;min-height:58px;text-align:left;border:2px solid #e2e6ee;background:#fff;color:#26334b;border-radius:14px;padding:10px 13px;font-size:16px;font-weight:800;cursor:pointer;transition:.14s}
.quiz-choice span{flex:0 0 32px;width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#eef1f7;color:#647187;font-size:13px;font-weight:950}
.quiz-choice:hover{border-color:#b8c0f8;transform:translateY(-1px)}
.quiz-choice.selected{border-color:var(--accent);background:#f2f4ff;box-shadow:0 5px 16px rgba(85,103,232,.10)}
.quiz-choice.selected span{background:var(--accent);color:#fff}
.quiz-choice.correct{border-color:#49b786;background:#ecfbf4;color:#116b49}
.quiz-choice.correct span{background:#36a875;color:#fff}
.quiz-choice.wrong{border-color:#e36a77;background:#fff0f2;color:#9f2f3d}
.quiz-choice:disabled{cursor:default;opacity:1}
.quiz-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.quiz-card .feedback span{font-weight:600}

/* Небольшая цветовая маркировка разделов меню */
.nav[href*="triangle-quiz"],.nav[href*="area"],.nav[href*="pyth"],.nav[href*="circles"],.nav[href*="coordinates"],.nav[href*="symmetry"],.nav[href*="polygons"],.nav[href*="angle-quiz"]{font-weight:760}

@media(max-width:1150px){
  .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content{max-width:760px}
}
@media(max-width:700px){
  body{background:#f7f8fc}
  .top{height:58px;padding:0 64px 0 12px}
  .logo{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .content{padding:9px 7px 24px}
  .hero{padding:22px 16px;margin-bottom:12px;border-radius:18px}
  .hero h1{font-size:27px;margin-top:5px}
  .hero p{font-size:14px;line-height:1.45}
  .hero:after{font-size:34px;right:6px;bottom:5px}
  .cards{grid-template-columns:1fr;gap:8px}
  .menu-card{min-height:0;padding:14px 15px;border-radius:15px;display:grid;grid-template-columns:38px 1fr;column-gap:9px;align-items:center}
  .menu-card .icon{grid-row:1/3;font-size:27px}
  .menu-card h3{margin:0;font-size:16px}
  .menu-card p{font-size:12px;line-height:1.35;margin-top:3px}
  .card{padding:12px 9px;border-radius:16px;box-shadow:0 5px 20px rgba(30,42,72,.06)}
  .head{margin-bottom:12px}
  .head h2{font-size:21px}
  .head p{font-size:12px;margin:4px 0}
  .head .btn{font-size:12px;min-height:40px;padding:8px 10px}
  .task{padding:10px 7px;margin-top:10px}
  .task-active h3{font-size:17px;line-height:1.25}
  .shape-fields{gap:11px}
  .grid-wrap{padding:4px 3px 6px;border-radius:9px}
  .grid-col-labels{--row-label:22px;font-size:9px;height:18px;margin-bottom:2px}
  .grid-body{--row-label:22px}
  .grid-row-labels{font-size:9px}
  .actions{gap:6px;margin-top:10px}
  .actions .btn{min-height:42px;font-size:12px;padding:8px 6px}
  .hint-bar{margin:7px 0;gap:6px}
  .hint-btn{min-height:40px;font-size:12px}

  .quiz-shell{padding:11px 8px}
  .quiz-topline{align-items:center}
  .quiz-score{font-size:11px;padding:5px 8px}
  .quiz-card{padding:13px 10px;border-radius:16px}
  .quiz-tag{font-size:9px;min-height:24px;padding:4px 8px}
  .quiz-card h3{font-size:19px;line-height:1.3;margin:10px 0 13px}
  .quiz-choices{grid-template-columns:1fr;gap:7px}
  .quiz-choice{min-height:50px;border-radius:12px;padding:8px 10px;font-size:14px}
  .quiz-choice span{width:28px;height:28px;flex-basis:28px;border-radius:8px}
  .quiz-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px}
  .quiz-actions .btn{width:100%;min-height:44px;padding:8px 6px;font-size:12px}
  .quiz-actions .btn:last-child{grid-column:1/-1}
  .feedback{font-size:12px;padding:9px 10px}
}
@media(max-width:390px){
  .top{padding-left:8px}
  .logo{font-size:15px}
  .content{padding-left:4px;padding-right:4px}
  .card{padding-left:6px;padding-right:6px}
  .quiz-shell{padding-left:4px;padding-right:4px}
  .quiz-card h3{font-size:18px}
}
