/* ============================================================
   Khan SAT-1600 · NEXT · Стили (css/next.css)
   Author: Xudoyorxon Bunyodov / Худоёрхон Бунёдов
   Палитра: forest #1B5E20 · gold #C9A227
   ============================================================ */

/* ---------- центрирование вопросов (исправление отображения) ---------- */
.q-img-wrap { display: block; margin: 10px auto; text-align: center; max-width: 100%; }
.q-img-wrap img { display: block; margin: 0 auto; max-width: 100% !important; height: auto; border-radius: 10px; }
.q-fig, .q-fig img, .rw-fig img { display: block; margin: 10px auto; max-width: min(440px, 100%) !important; height: auto; }
.q-text { max-width: 820px; margin: 0 auto; }
.choices { max-width: 820px; margin: 8px auto 0; }
.nx-img-fallback { display: flex; align-items: center; justify-content: center; min-height: 120px; background: #F4F1E6; border: 1px dashed #C9A227; border-radius: 10px; color: #6b6b5a; font-size: 13px; padding: 12px; text-align: center; }
@media (min-width: 520px) { .q-fig img { max-width: 440px !important; } }

/* ---------- динамические темы времени суток и погоды ---------- */
body.nx-bg-morning { background: linear-gradient(180deg, #FFF6E4 0%, #FDFDF6 42%) fixed; }
body.nx-bg-day { background: linear-gradient(180deg, #F2FBEF 0%, #FDFDF6 42%) fixed; }
body.nx-bg-evening { background: linear-gradient(180deg, #FFEAD2 0%, #FBF7EC 46%) fixed; }
body.nx-bg-night { background: linear-gradient(180deg, #14231B 0%, #1D2B22 100%) fixed; }
body.nx-bg-night .panel, body.nx-bg-night .card { background: rgba(255, 255, 255, .93); }
/* ===== ЦВЕТОВАЯ ЗАЛИВКА ФОНА ПО ПОГОДЕ =====
   Красим сам фон страницы (позади карточек) — цвет виден, но текст не страдает.
   Специфичность 2+ класса перекрывает nx-bg-day/morning/evening. */

/* ☀️ ТЕПЛО — золотистый свет */
body.nx-w-clear.nx-warm, body.nx-w-clear:not(.nx-hot):not(.nx-cold):not(.nx-freeze) {
  background:
    radial-gradient(900px 640px at 88% -6%, rgba(255, 206, 74, .55), rgba(255, 228, 150, .26) 46%, transparent 76%),
    linear-gradient(180deg, #FFF3D2 0%, #FFFAEC 42%, #FDFDF6 100%) fixed;
}
/* 🔥 ЖАРА 30°+ — максимально жёлтый воздух */
body.nx-w-clear.nx-hot {
  background:
    radial-gradient(1000px 700px at 88% -8%, rgba(255, 188, 32, .70), rgba(255, 214, 96, .34) 44%, transparent 78%),
    linear-gradient(180deg, #FFE9A8 0%, #FFF2C9 38%, #FFFAE6 100%) fixed;
}
/* ❄️ СНЕГ — холодная синева на весь фон */
body.nx-w-snow {
  background: linear-gradient(180deg, #C7DFF5 0%, #DCEBF9 45%, #EFF6FC 100%) fixed;
}
body.nx-w-snow.nx-cold {
  background: linear-gradient(180deg, #AFD1F1 0%, #CBE1F7 45%, #E7F2FB 100%) fixed;
}
/* 🧊 МОРОЗ −5° и ниже — самый насыщенный синий */
body.nx-w-snow.nx-freeze {
  background: linear-gradient(180deg, #93BFEC 0%, #B6D5F4 42%, #DCEDFA 100%) fixed;
}
/* 🌧️ дождь · ⛈️ гроза · ☁️ облачно · 🌫️ туман · 🌙 ясная ночь */
body.nx-w-rain { background: linear-gradient(180deg, #C3D2E6 0%, #DEE7F1 46%, #F2F5F9 100%) fixed; }
body.nx-w-storm { background: linear-gradient(180deg, #9AA4BC 0%, #C2C9D8 44%, #E8EBF1 100%) fixed; }
body.nx-w-clouds { background: linear-gradient(180deg, #DDE2E8 0%, #EDF0F3 46%, #FAFBFC 100%) fixed; }
body.nx-w-fog { background: linear-gradient(180deg, #E2E5EA 0%, #EDEFF2 45%, #F7F8FA 100%) fixed; }
body.nx-w-clear-night { background: linear-gradient(180deg, #16233C 0%, #1D2B47 45%, #223050 100%) fixed; }
body.nx-w-clear-night .panel, body.nx-w-clear-night .card { background: rgba(255, 255, 255, .95); }

/* ===== ПОГОДА: живой визуальный слой поверх фона (не мешает кликам) ===== */
body.nx-w-rain::before, body.nx-w-snow::before, body.nx-w-clouds::before,
body.nx-w-storm::before, body.nx-w-fog::before,
body.nx-w-clear::before, body.nx-w-clear-night::before,
body.nx-w-clear::after, body.nx-w-clear-night::after, body.nx-w-storm::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
}

/* ☀️ ЯСНО (день): ПАДАЮЩИЕ ЛУЧИ — широкие световые полосы наискось + солнце */
body.nx-w-clear::before {
  background: repeating-linear-gradient(74deg,
      transparent 0 46px,
      rgba(255, 232, 150, .16) 46px 78px,
      rgba(255, 244, 200, .09) 78px 104px,
      transparent 104px 168px);
  animation: nxRayFall 9s linear infinite;
  opacity: .85;
}
body.nx-w-clear.nx-warm::before { opacity: 1; }
body.nx-w-clear.nx-hot::before {
  opacity: 1;
  background: repeating-linear-gradient(74deg,
      transparent 0 40px,
      rgba(255, 214, 96, .30) 40px 76px,
      rgba(255, 236, 168, .17) 76px 106px,
      transparent 106px 160px);
  animation-duration: 7s;
}
@keyframes nxRayFall { to { background-position: 168px 168px; } }

body.nx-w-clear::after {
  background:
    radial-gradient(190px 190px at 88% 7%, rgba(255, 250, 226, .95), rgba(255, 226, 130, .55) 32%, rgba(255, 208, 90, .22) 55%, transparent 72%),
    conic-gradient(from 0deg at 88% 7%, rgba(255,226,140,.22) 0deg, transparent 10deg, rgba(255,226,140,.22) 22deg, transparent 32deg, rgba(255,226,140,.22) 44deg, transparent 54deg, rgba(255,226,140,.22) 66deg, transparent 76deg, rgba(255,226,140,.22) 88deg, transparent 98deg, rgba(255,226,140,.22) 110deg, transparent 120deg);
  animation: nxSunRay 70s linear infinite;
}
body.nx-w-clear.nx-hot::after {
  background:
    radial-gradient(230px 230px at 88% 7%, rgba(255, 252, 232, 1), rgba(255, 214, 90, .72) 30%, rgba(255, 186, 48, .34) 54%, transparent 74%),
    conic-gradient(from 0deg at 88% 7%, rgba(255,206,90,.34) 0deg, transparent 10deg, rgba(255,206,90,.34) 22deg, transparent 32deg, rgba(255,206,90,.34) 44deg, transparent 54deg, rgba(255,206,90,.34) 66deg, transparent 76deg, rgba(255,206,90,.34) 88deg, transparent 98deg, rgba(255,206,90,.34) 110deg, transparent 120deg);
  animation: nxSunRay 55s linear infinite;
}
@keyframes nxSunRay { to { transform: rotate(360deg); } }

/* 🌙 ЯСНО (ночь): звёздное небо */
body.nx-w-clear-night::before {
  opacity: .9;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 32% 32%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.8px 1.8px at 54% 12%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 68% 40%, rgba(255,255,255,.85), transparent),
    radial-gradient(1.7px 1.7px at 82% 22%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 24% 54%, rgba(255,255,255,.75), transparent),
    radial-gradient(1.4px 1.4px at 90% 60%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.2px 1.2px at 44% 66%, rgba(255,255,255,.65), transparent);
  animation: nxTwinkle 4s ease-in-out infinite;
}
body.nx-w-clear-night::after {
  background: radial-gradient(140px 140px at 84% 13%, rgba(244, 246, 255, .6), rgba(220, 228, 255, .22) 44%, transparent 62%);
}
@keyframes nxTwinkle { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* 🌧️ ДОЖДЬ: две полосы капель с разной скоростью (глубина) */
body.nx-w-rain::before {
  opacity: .7;
  background-image:
    repeating-linear-gradient(102deg, transparent 0 22px, rgba(110, 145, 210, .30) 22px 23px),
    repeating-linear-gradient(100deg, transparent 0 34px, rgba(150, 178, 224, .20) 34px 35px);
  background-size: 100px 90px, 130px 130px;
  animation: nxRain1 .55s linear infinite, nxRain2 .9s linear infinite;
}
@keyframes nxRain1 { to { background-position: 24px 90px, 0 0; } }
@keyframes nxRain2 { to { background-position: 0 0, 30px 130px; } }

/* ❄️ СНЕГ: крупные заметные хлопья, три слоя глубины + покачивание */
body.nx-w-snow::before {
  opacity: 1;
  background-image:
    radial-gradient(4.5px 4.5px at 20% 10%, #fff, rgba(255,255,255,.5) 60%, transparent),
    radial-gradient(3.6px 3.6px at 62% 28%, #fff, rgba(255,255,255,.45) 62%, transparent),
    radial-gradient(5px 5px at 80% 16%, #fff, rgba(255,255,255,.5) 58%, transparent),
    radial-gradient(3px 3px at 38% 58%, rgba(255,255,255,.95), transparent 68%),
    radial-gradient(4px 4px at 90% 68%, #fff, rgba(255,255,255,.45) 60%, transparent),
    radial-gradient(2.6px 2.6px at 8% 74%, rgba(255,255,255,.9), transparent 70%),
    radial-gradient(3.4px 3.4px at 50% 88%, #fff, transparent 66%);
  background-size: 190px 190px, 240px 240px, 170px 170px, 280px 280px, 150px 150px, 220px 220px, 200px 200px;
  filter: drop-shadow(0 1px 2px rgba(60, 110, 170, .35));
  animation: nxSnow1 8s linear infinite, nxSnowSway 5s ease-in-out infinite;
}
@keyframes nxSnow1 { to { background-position: 12px 190px, -16px 240px, 10px 170px, -12px 280px, 14px 150px, -8px 220px, 6px 200px; } }
@keyframes nxSnowSway { 0%, 100% { transform: translateX(-10px); } 50% { transform: translateX(10px); } }

/* ☁️ ОБЛАЧНО: серая дымка сверху + медленные облака */
body.nx-w-clouds::before {
  opacity: .55;
  background:
    radial-gradient(140px 70px at 20% 12%, rgba(200, 205, 212, .55), transparent 70%),
    radial-gradient(180px 80px at 62% 8%, rgba(190, 196, 205, .5), transparent 72%),
    radial-gradient(150px 70px at 88% 16%, rgba(205, 210, 216, .45), transparent 70%),
    linear-gradient(180deg, rgba(195, 200, 208, .24), transparent 45%);
  background-size: 240% 100%, 240% 100%, 240% 100%, 100% 100%;
  animation: nxClouds 60s linear infinite;
}
@keyframes nxClouds { to { background-position: 240% 0, 200% 0, 260% 0, 0 0; } }

/* 🌫️ ТУМАН: молочная пелена, дышит */
body.nx-w-fog::before {
  background: linear-gradient(180deg, rgba(224, 226, 230, .5), rgba(214, 218, 224, .32) 45%, rgba(224, 226, 230, .5));
  animation: nxFog 12s ease-in-out infinite;
}
@keyframes nxFog { 0%, 100% { opacity: .35; } 50% { opacity: .6; } }

/* ⛈️ ГРОЗА: тучи + вспышки молний */
body.nx-w-storm::before {
  opacity: .6;
  background:
    radial-gradient(160px 80px at 30% 10%, rgba(90, 96, 110, .6), transparent 72%),
    radial-gradient(200px 90px at 70% 6%, rgba(70, 76, 92, .55), transparent 74%),
    linear-gradient(180deg, rgba(60, 66, 84, .32), transparent 46%);
  background-size: 240% 100%, 240% 100%, 100% 100%;
  animation: nxClouds 40s linear infinite;
}
body.nx-w-storm::after { animation: nxStorm 7s steps(1) infinite; }
@keyframes nxStorm {
  0%, 90%, 94%, 98% { background: transparent; }
  92% { background: radial-gradient(600px 400px at 60% 20%, rgba(255,255,220,.6), transparent 60%); }
  96% { background: radial-gradient(500px 350px at 40% 15%, rgba(230,235,255,.5), transparent 55%); }
}

/* уважение к «меньше движения» */
body.nx-nomotion::before, body.nx-nomotion::after { animation: none !important; }

/* ===== чип погоды в шапке ===== */
.wx-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); color: #F4E7B8; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1; transition: background .2s, transform .15s, border-color .2s; white-space: nowrap; }
.wx-chip:hover { background: rgba(255, 255, 255, .24); transform: translateY(-1px); border-color: rgba(201, 162, 39, .7); }
.wx-chip .wx-ic { font-size: 15px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.wx-chip b { font-weight: 800; }
.wx-chip .wx-city { opacity: .85; font-weight: 500; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.wx-chip.wx-clear { background: rgba(255, 213, 92, .22); border-color: rgba(255, 213, 92, .55); }
.wx-chip.wx-rain { background: rgba(120, 150, 210, .24); border-color: rgba(120, 150, 210, .55); }
.wx-chip.wx-snow { background: rgba(220, 235, 255, .26); border-color: rgba(200, 225, 255, .6); color: #EAF4FF; }
.wx-chip.wx-storm { background: rgba(90, 96, 130, .3); border-color: rgba(150, 155, 190, .6); }
@media (max-width: 720px) { .wx-chip .wx-city { display: none; } }
@media (max-width: 560px) { .wx-chip { padding: 5px 8px; } }

/* купленные визуальные темы */
body.nx-neon .panel, body.nx-neon .card { box-shadow: 0 0 0 1px #1B5E20, 0 0 18px rgba(0, 220, 130, .35) !important; }
body.nx-neon .btn-gold { box-shadow: 0 0 14px rgba(201, 162, 39, .8); }
body.nx-grad { background: linear-gradient(160deg, #E8F8EC, #FDF3D8, #E4F2FF) fixed; }
body.nx-focus .sidebar, body.nx-focus .ext-banner, body.nx-focus .nx-po { display: none !important; }
body.nx-relax { filter: saturate(.9); }

/* ---------- хаб NEXT ---------- */
.nx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.nx-mod { position: relative; padding: 14px 12px; border-radius: 14px; background: linear-gradient(160deg, #ffffff, #F6FBF4); border: 1px solid #DCE6DA; cursor: pointer; transition: transform .16s, box-shadow .16s; text-align: center; }
.nx-mod:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(27, 94, 32, .16); border-color: #C9A227; }
.nx-mod .ic { font-size: 30px; }
.nx-mod .nm { font-weight: 700; color: #123A16; font-size: 13.5px; margin-top: 5px; }
.nx-mod .ct { font-size: 11px; color: #7b8577; }
.nx-statrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
#nx-focusbar { position: sticky; top: 0; z-index: 5; height: 6px; border-radius: 4px; background: #E7E3D2; overflow: hidden; margin-bottom: 8px; }
#nx-focusbar > div { height: 100%; background: linear-gradient(90deg, #1B5E20, #C9A227); transition: width .8s; }

/* ---------- списки функций ---------- */
.nx-featlist { display: flex; flex-direction: column; gap: 6px; }
.nx-feat { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px; background: #fff; border: 1px solid #E6E2D2; }
.nx-feat:hover { border-color: #C9A227; }
.nx-fid { min-width: 34px; font-weight: 800; color: #1B5E20; text-align: center; }
.nx-ft { flex: 1; font-size: 14px; line-height: 1.35; }
.nx-stag { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; font-weight: 700; }
.nx-s-full { background: #E1F2E1; color: #1B5E20; }
.nx-s-hw { background: #F6ECCE; color: #8A6D14; }
.nx-s-beta { background: #ECECEC; color: #666; }

/* ---------- оверлей и диалоги NEXT ---------- */
.nx-overlay { position: fixed; inset: 0; background: rgba(16, 28, 18, .55); backdrop-filter: blur(3px); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 14px; }
.nx-dialog { width: min(760px, 100%); max-height: 88vh; overflow: auto; background: #FDFDF6; border-radius: 18px; border: 1px solid #D9D4C0; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: nxPop .22s ease; }
@keyframes nxPop { from { transform: scale(.92); opacity: 0; } }
.nx-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #E8E4D4; position: sticky; top: 0; background: #FDFDF6; z-index: 2; border-radius: 18px 18px 0 0; }
.nx-dialog-head b { color: #123A16; font-size: 16px; }
.nx-dialog-body { padding: 14px 16px 18px; }
.nx-dialog hr { border: 0; border-top: 1px solid #E8E4D4; margin: 12px 0; }

/* эффекты */
.nx-fx { position: fixed; inset: 0; pointer-events: none; z-index: 400; }
.nx-skel { background: linear-gradient(90deg, #EEE9DA 25%, #F8F4E6 50%, #EEE9DA 75%); background-size: 200% 100%; animation: nxShimmer 1.1s infinite; border-radius: 8px; min-height: 16px; }
@keyframes nxShimmer { to { background-position: -200% 0; } }
.nx-pulse-ok { animation: nxOk .5s; }
.nx-pulse-no { animation: nxNo .45s; }
@keyframes nxOk { 30% { box-shadow: 0 0 0 6px rgba(46, 125, 50, .35); } }
@keyframes nxNo { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
.nx-pagein { animation: nxIn .3s ease; }
@keyframes nxIn { from { opacity: 0; transform: translateY(8px); } }
body.nx-nomotion *, body.nx-nomotion *::before { animation: none !important; transition: none !important; }

/* ---------- По (маскот) ---------- */
.nx-po { position: fixed; right: 14px; bottom: 76px; z-index: 120; font-size: 44px; cursor: pointer; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); transition: transform .2s; }
.nx-po:hover { transform: scale(1.12); }
.nx-po-hop { animation: nxHop .6s; }
@keyframes nxHop { 30% { transform: translateY(-16px) rotate(-8deg); } 60% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
.nx-po-sad { filter: grayscale(.5) drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); }
.nx-po-bubble { position: fixed; right: 66px; bottom: 86px; z-index: 120; max-width: 230px; background: #fff; border: 1.5px solid #1B5E20; border-radius: 14px 14px 2px 14px; padding: 9px 12px; font-size: 13px; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); opacity: 0; transform: translateY(6px); transition: .25s; pointer-events: none; }
.nx-po-bubble.on { opacity: 1; transform: none; }

/* опции и flip-карты */
.nx-opts { display: flex; flex-direction: column; gap: 7px; }
.nx-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid #E6E2D2; cursor: pointer; font-size: 14px; }
.nx-opt input { accent-color: #1B5E20; }
.nx-flip { perspective: 900px; cursor: pointer; }
.nx-flip-in { position: relative; width: 100%; min-height: 120px; transition: transform .5s; transform-style: preserve-3d; }
.nx-flip.on .nx-flip-in { transform: rotateY(180deg); }
.nx-flip-f, .nx-flip-b { position: absolute; inset: 0; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; border-radius: 12px; padding: 14px; text-align: center; }
.nx-flip-f { background: #1B5E20; color: #fff; font-weight: 700; }
.nx-flip-b { background: #F6ECCE; transform: rotateY(180deg); }

/* чат-логи */
.nx-chatlog { display: flex; flex-direction: column; gap: 6px; }
.nx-msg { max-width: 86%; padding: 7px 11px; border-radius: 13px; font-size: 13.5px; line-height: 1.35; }
.nx-msg.me { align-self: flex-end; background: #1B5E20; color: #fff; border-bottom-right-radius: 3px; }
.nx-msg.po { align-self: flex-start; background: #F1EDDC; border-bottom-left-radius: 3px; }

/* ---------- кампус: комнаты и доска ---------- */
.nx-av-pick { font-size: 26px; padding: 4px 7px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.nx-av-pick.on { border-color: #C9A227; background: #FBF4DC; }
.nx-scene { position: relative; width: 100%; height: 300px; background: linear-gradient(180deg, #EAF4E6 60%, #DCEBD5 60%); border-radius: 14px; overflow: hidden; border: 1px solid #D5E0CE; touch-action: none; }
.nx-room-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.nx-room-bar { display: flex; gap: 6px; margin-top: 8px; }
.nx-wb { width: 100%; background: #fff; border: 1px solid #D9D4C0; border-radius: 12px; touch-action: none; }
.nx-wb-tools { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.nx-roomgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.nx-rgc { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #F7F4E8; border: 1px solid #E4DFC9; border-radius: 8px; cursor: pointer; }
.nx-rgc:hover { border-color: #C9A227; }

/* рейд и сетки */
.nx-raidbar { height: 16px; background: #E7E3D2; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.nx-raidfill { height: 100%; background: linear-gradient(90deg, #C0453B, #E08A2E); transition: width .5s; }
.nx-bracket { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.nx-brk { padding: 4px 10px; border-radius: 999px; background: #F1EDDC; font-size: 12.5px; }
.nx-brk.me { background: #1B5E20; color: #fff; font-weight: 700; }

/* сертификаты */
.nx-cert { background: linear-gradient(160deg, #FFFDF4, #F8F2DC); border: 3px double #C9A227 !important; }
.nx-cert-in { text-align: center; padding: 16px 10px; }
.nx-cert-in b { letter-spacing: 2px; color: #1B5E20; }

/* теплокарта */
.nx-heat { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.nx-heatc { border-radius: 12px; color: #fff; padding: 12px; text-align: center; }

/* ---------- доступность ---------- */
#nx-headcur { position: fixed; z-index: 500; transform: translate(-50%, -50%); font-size: 26px; pointer-events: none; transition: transform .12s; }
.nx-scan-hl { outline: 4px solid #C9A227 !important; outline-offset: 2px; border-radius: 8px; }
body.nx-adhd .sidebar, body.nx-adhd .ext-banner, body.nx-adhd .nx-po, body.nx-adhd .stats { display: none !important; }
body.nx-adhd #app { max-width: 720px; margin: 0 auto; }
body.nx-adhd .panel, body.nx-adhd .card { box-shadow: none !important; }
body.nx-dyslexia2 { --dysgap: 1px; }
body.nx-dyslexia2 #app { letter-spacing: var(--dysgap); word-spacing: calc(var(--dysgap) * 2.2); line-height: 1.85; font-family: Verdana, "Comic Sans MS", sans-serif; }
body.nx-dyslexia2 .q-text, body.nx-dyslexia2 .ctxt { background: linear-gradient(180deg, transparent 82%, rgba(201, 162, 39, .25) 82%); }
body.nx-noanxiety .timer, body.nx-noanxiety .ext-arena-score, body.nx-noanxiety .countdown, body.nx-noanxiety [data-timer] { display: none !important; }
body.nx-linear .nx-grid { grid-template-columns: 1fr; }
body.nx-linear .panel, body.nx-linear .card { border-left: 4px solid #1B5E20; }

/* ---------- XR ---------- */
.nx-xr { width: 100%; border-radius: 14px; background: #0B1A0D; cursor: grab; display: block; }
.nx-xr:active { cursor: grabbing; }
.nx-xr-bar { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.nx-rsvp { margin-top: 14px; text-align: center; font-size: 34px; font-weight: 700; font-family: Georgia, serif; min-height: 52px; color: #123A16; }

/* ---------- био ---------- */
.nx-breath-wrap { display: flex; flex-direction: column; align-items: center; padding: 16px 0; }
.nx-breath { width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #7CC98A, #1B5E20); box-shadow: 0 0 40px rgba(27, 94, 32, .4); transition: transform .3s linear; }
.nx-hr-hud { position: fixed; left: 12px; bottom: 76px; z-index: 120; background: #fff; border: 2px solid #1B5E20; border-radius: 999px; padding: 6px 12px; font-weight: 800; color: #1B5E20; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.nx-hr-hud.hi { border-color: #C0453B; color: #C0453B; animation: nxHr 1s infinite; }
@keyframes nxHr { 50% { transform: scale(1.08); } }
.nx-sleepbar { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-top: 12px; background: #F7F4E8; border-radius: 10px; padding: 6px; }
.nx-slp { flex: 1; min-width: 8px; background: linear-gradient(180deg, #C9A227, #1B5E20); border-radius: 4px 4px 0 0; }

/* режим отдыха (restLock из ядра) */
.nx-rest { position: fixed; inset: 0; z-index: 600; background: rgba(14, 26, 17, .92); display: flex; align-items: center; justify-content: center; }
.nx-rest-card { text-align: center; color: #F2E7C9; padding: 26px; }
.nx-rest-card .big { font-size: 60px; }

/* ночной тёплый экран */
body.nx-nightshift { filter: sepia(.18) brightness(.97); }

/* мелочи */
.nx-brainz path, .nx-brainz ellipse { transition: fill .2s; cursor: pointer; }
.nx-brainz .on { fill: #C9A227 !important; }
@media (max-width: 560px) {
  .nx-grid { grid-template-columns: repeat(2, 1fr); }
  .nx-dialog { max-height: 92vh; border-radius: 14px; }
  .nx-po { bottom: 90px; font-size: 38px; }
}

/* ============================================================
   «8K» POLISH LAYER — чёткость, плавность, современность
   ============================================================ */

/* --- глобальная чёткость текста и графики --- */
html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}
h1, h2, h3, .stat .n, .nx-mod .nm { letter-spacing: -0.01em; }
img { image-rendering: auto; }
canvas { max-width: 100%; }
svg.svgi { width: 1.15em; height: 1.15em; vertical-align: -0.18em; flex: none; }
svg.svgi .gold { stroke: #C9A227; }
.btn svg.svgi { margin-right: 2px; }

/* --- изображения заданий: натуральная резкость + зум --- */
.q-fig, .q-fig img, .rw-fig img { max-width: min(760px, 100%) !important; }
.q-img-wrap img { max-width: min(940px, 100%) !important; box-shadow: 0 6px 22px rgba(18, 42, 22, .10); }
img.nx-zoomable { cursor: zoom-in; transition: box-shadow .2s, transform .25s cubic-bezier(.2,.7,.3,1); }
img.nx-zoomable:hover { box-shadow: 0 12px 34px rgba(18, 42, 22, .18); transform: translateY(-1px); }

/* --- плавные микровзаимодействия (единая кривая) --- */
:root { --nx-ease: cubic-bezier(.22, .7, .3, 1); }
.btn, .nx-mod, .nx-feat, .choice, .card, .panel, .stat, .tab, .nav a, .nx-opt, .nx-rgc, input, select, textarea {
  transition: transform .18s var(--nx-ease), box-shadow .22s var(--nx-ease), border-color .2s, background-color .2s, color .2s, opacity .2s;
}
.btn { position: relative; overflow: hidden; will-change: transform; }
.btn:hover { transform: translateY(-1px); }
.btn:active, .choice:active, .nx-mod:active { transform: translateY(0) scale(.97); }
.btn-gold { box-shadow: 0 4px 14px rgba(201, 162, 39, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-gold:hover { box-shadow: 0 8px 22px rgba(201, 162, 39, .45), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-gold::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); transition: left .55s var(--nx-ease); }
.btn-gold:hover::after { left: 130%; }
.choice:hover { transform: translateX(3px); border-color: #C9A227; }
.nx-feat:hover { transform: translateX(2px); box-shadow: 0 4px 14px rgba(27, 94, 32, .08); }
.card:hover, .stat:hover { box-shadow: 0 10px 28px rgba(18, 42, 22, .10); }

/* --- глубина стекла и света --- */
.panel, .card, .nx-dialog {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .65), rgba(255, 255, 255, 0) 46px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 30px rgba(18, 42, 22, .08);
}
.nx-overlay { backdrop-filter: blur(6px) saturate(1.15); }
.nx-dialog { box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 30px 80px rgba(0, 0, 0, .32); }
.nx-mod { background-image: radial-gradient(120% 90% at 50% -10%, rgba(201, 162, 39, .10), transparent 55%), linear-gradient(160deg, #ffffff, #F6FBF4); }
.nx-mod:hover { box-shadow: 0 14px 30px rgba(27, 94, 32, .18), 0 2px 0 rgba(201, 162, 39, .5) inset; }
.nx-mod-ic { font-size: 30px; line-height: 1; color: #1B5E20; }
.nx-mod-ic svg.svgi { width: 34px; height: 34px; vertical-align: middle; filter: drop-shadow(0 3px 5px rgba(27, 94, 32, .22)); }

/* --- волосяные линии на Retina --- */
@media (min-resolution: 2dppx) {
  .card, .panel, .nx-feat, .nx-opt, .nx-dialog, .nx-mod, table td, table th { border-width: .5px; }
}

/* --- фокус и выделение --- */
:focus { outline: none; }
:focus-visible { outline: 2.5px solid #C9A227; outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(201, 162, 39, .35); color: #123A16; }
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: #1B5E20; }

/* --- современный скроллбар --- */
* { scrollbar-width: thin; scrollbar-color: rgba(27, 94, 32, .45) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #2E7D32, #1B5E20); border-radius: 999px; border: 2px solid #FDFDF6; }
*::-webkit-scrollbar-thumb:hover { background: #C9A227; }
*::-webkit-scrollbar-track { background: transparent; }

/* --- поля ввода --- */
input, select, textarea { border-radius: 10px; }
input:hover, select:hover, textarea:hover { border-color: #9CB89A; }
input:focus, select:focus, textarea:focus { border-color: #1B5E20; box-shadow: 0 0 0 3.5px rgba(27, 94, 32, .14); }

/* --- появление контента --- */
#app > * { animation: nxIn .28s var(--nx-ease); }
.nx-dialog-body > * { animation: nxIn .3s var(--nx-ease) backwards; }
.nx-dialog-body > *:nth-child(2) { animation-delay: .04s; }
.nx-dialog-body > *:nth-child(3) { animation-delay: .08s; }

/* --- крупные тач-цели на мобильных --- */
@media (max-width: 560px) {
  .btn { min-height: 42px; }
  .choice { min-height: 46px; }
  input, select { min-height: 40px; font-size: 16px; }
}

/* --- уважение к reduce-motion (и класс nomotion) --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- разбор ответа (объяснения из книги автора) --- */
.nx-expl { margin-top: 12px; border: 1px solid #E3DFC9; border-left: 4px solid #C9A227; border-radius: 12px; background: linear-gradient(180deg, #FFFDF4, #FBF8EC); overflow: hidden; }
.nx-expl > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: #123A16; list-style: none; user-select: none; }
.nx-expl > summary::-webkit-details-marker { display: none; }
.nx-expl > summary::before { content: "▸ "; color: #C9A227; }
.nx-expl[open] > summary::before { content: "▾ "; }
.nx-expl > summary:hover { background: rgba(201, 162, 39, .10); }
.nx-expl-body { padding: 2px 16px 14px; font-size: 14.5px; line-height: 1.65; color: #26312A; max-width: 820px; }

/* --- задание без ключа: переход на разобранные варианты --- */
.nx-nokey { margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid #E3DFC9; border-left: 4px solid #1B5E20; background: linear-gradient(180deg, #F6FBF4, #FFFFFF); font-size: 14px; line-height: 1.55; }
.nx-nokey b { color: #123A16; display: block; margin-bottom: 4px; }

/* насыщенность погодного эффекта (настройки → 🌤 Погода за окном) */
html.nx-wx-soft body { background-blend-mode: normal; filter: saturate(.72); }
html.nx-wx-soft body::before, html.nx-wx-soft body::after { opacity: .4 !important; }
html.nx-wx-vivid body { filter: saturate(1.22) contrast(1.03); }
html.nx-wx-vivid body::before { filter: saturate(1.25) brightness(1.06); }
