/* Апекс · «Рассвет 2» для тренажёра звёздного неба.
   Те же токены и приметы, что на платформе apeks.space (lms/www/landing.html,
   frontend/src/styles/dawn2.css): сиреневая бумага, чернильные рамки 1.5–2px,
   лимонная главная кнопка с жёсткой тенью, скругления 4/8/12, шрифт Geologica.
   Карты неба (canvas) остаются ночными — это сам предмет, а не украшение. */

@font-face {
	font-family: 'Geologica';
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url('/apeks/fonts/geologica-normal-400_800-cyrillic.woff2') format('woff2');
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
	font-family: 'Geologica';
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url('/apeks/fonts/geologica-normal-400_800-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
		U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
		U+FEFF, U+FFFD;
}

:root {
	--lemon: #FFF851;
	--lemon-hover: #FFF330;
	--violet: #A400FF;
	--violet-hover: #8A00D6;
	--purple: #6922BF;
	--coral: #FF8562;
	--lilac: #FAF0FF;
	--lilac-2: #EFD9FF;
	--paper: #FDFCFF;
	--ink: #0D0B10;
	--ink-2: #2B2731;
	--muted: #4B4553;
	--line: #DDD0F0;
	--line-strong: #C6B4E2;
	--night: #24104F;
	--night-2: #1B093C;
	--night-3: #361370;
	--ok: #1F7A4D;
	--ok-bg: #E3F6EC;
	--bad: #B3261E;
	--bad-bg: #FDE8E6;

	--r-sm: 4px;
	--r: 8px;
	--r-lg: 12px;
	--ease: cubic-bezier(0.23, 1, 0.32, 1);
	--font: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--shadow-hard: 3px 3px 0 var(--ink);
	--shadow-soft: 0 1px 2px rgb(60 21 145 / 0.08);
	--focus: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--violet);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body.ap {
	margin: 0;
	background: var(--lilac);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: geometricPrecision;
}
.ap h1, .ap h2, .ap h3, .ap h4 { margin: 0; font-family: var(--font); letter-spacing: -0.025em; line-height: 1.15; color: inherit; }
.ap p { margin: 0; }
.ap a { color: var(--violet); text-decoration: none; transition: color .15s, background-color .15s, border-color .15s, transform .15s, box-shadow .15s; }
.ap a:hover { color: var(--purple); }
.ap :focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.ap .accent { color: var(--violet); }
.ap .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.ap .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Шапка ------------------------------------------------------------ */
.ap-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom: 1.5px solid var(--line);
}
.ap-header-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.ap-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--ink) !important; }
.ap-brand img { width: 32px; height: 32px; border-radius: 9999px; }
.ap-brand-word {
	display: inline-block; padding: 3px 9px;
	font-size: 15px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2;
	color: var(--ink); background: var(--lemon);
	border: 2px solid var(--ink); border-radius: 6px; box-shadow: 2px 2px 0 var(--ink);
}
.ap-brand-sub { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ap-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ap-nav a {
	display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px;
	border-radius: var(--r); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.ap-nav a:hover { background: var(--lilac); color: var(--ink); }
.ap-nav a[aria-current="page"] { background: var(--lemon); color: var(--ink); border: 1.5px solid var(--ink); }
.ap-nav .ap-nav-school { border: 1.5px solid var(--line-strong); background: #FFFFFF; color: var(--ink); margin-left: 6px; }
.ap-nav .ap-nav-school:hover { border-color: var(--ink); }
.ap-burger { display: none; margin-left: auto; width: 42px; height: 42px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: #FFFFFF; cursor: pointer; }
.ap-burger span { display: block; width: 18px; height: 2px; margin: 4px auto; background: var(--ink); border-radius: 2px; }
@media (max-width: 860px) {
	.ap-brand-sub { display: none; }
	.ap-burger { display: block; }
	.ap-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 12px 12px;
		background: #FFFFFF; border-bottom: 1.5px solid var(--line);
	}
	.ap-nav.open { display: flex; }
	.ap-nav .ap-nav-school { margin-left: 0; }
}

/* ---- Кнопки ----------------------------------------------------------- */
.ap-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 20px; border-radius: var(--r);
	font-family: var(--font); font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center;
	cursor: pointer; touch-action: manipulation; user-select: none;
	transition: background-color .15s, transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s, color .15s;
}
.ap-btn:disabled, .ap-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none !important; }
.ap-btn-primary { background: var(--lemon); color: var(--ink) !important; border: 2px solid var(--ink); box-shadow: var(--shadow-hard); }
.ap-btn-primary:hover { background: var(--lemon-hover); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.ap-btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ap-btn-violet { background: var(--violet); color: #FFFFFF !important; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.ap-btn-violet:hover { background: var(--violet-hover); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.ap-btn-violet:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.ap-btn-ghost { background: #FFFFFF; color: var(--ink) !important; border: 1.5px solid var(--ink); font-weight: 600; }
.ap-btn-ghost:hover { background: var(--lilac); }
.ap-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.ap-btn-block { width: 100%; }

/* ---- Сцены: ночь с зарёй (как обложка платформы) ---------------------- */
.ap-night {
	position: relative; overflow: hidden; color: #FFFFFF;
	background: linear-gradient(118deg, var(--night-2) 0%, var(--night) 58%, var(--night-3) 100%);
	border-bottom: 2px solid var(--ink);
}
.ap-night h1, .ap-night h2 { color: #FFFFFF; }
.ap-night .accent { color: var(--lemon); }
.ap-night .ap-btn-ghost { background: rgba(255, 255, 255, 0.08); color: #FFFFFF !important; border-color: rgba(255, 255, 255, 0.5); }
.ap-night .ap-btn-ghost:hover { background: rgba(255, 255, 255, 0.16); border-color: #FFFFFF; }
.ap-scene { position: absolute; right: 0; bottom: 0; width: 680px; max-width: none; height: auto; pointer-events: none; }
.ap-scene .ap-orbit-planet { offset-path: none; }
.ap-cstar { transform-box: fill-box; transform-origin: 50% 50%; animation: ap-glint 3.4s ease-in-out infinite; }
.ap-cstar:nth-child(2n) { animation-duration: 4.1s; animation-delay: -1.2s; }
.ap-cstar:nth-child(3n) { animation-duration: 2.8s; animation-delay: -2.1s; }
@keyframes ap-glint { 0%, 100% { opacity: .6; transform: scale(.86); } 45% { opacity: 1; transform: scale(1.22) rotate(10deg); } }
@media (prefers-reduced-motion: reduce) {
	.ap-cstar { animation: none; }
	.ap-scene animateMotion { display: none; }
	.ap-btn, .ap a { transition: none; }
}
.ap-eyebrow {
	display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; margin-bottom: 18px;
	border-radius: 6px; font-size: 13px; font-weight: 600;
	border: 1.5px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.1); color: #FFFFFF;
}
.ap-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 9999px; background: var(--lemon); }

/* ---- Секции и карточки ------------------------------------------------ */
.ap-section { padding: 64px 0; }
.ap-section-head { max-width: 680px; margin-bottom: 28px; }
.ap-h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; margin-bottom: 10px !important; }
.ap-lead { font-size: 17px; color: var(--muted); }
.ap-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ap-card {
	position: relative; display: flex; flex-direction: column; gap: 10px;
	padding: 22px; border-radius: var(--r-lg);
	background: #FFFFFF; border: 1.5px solid var(--line); box-shadow: var(--shadow-soft);
}
.ap-card h3 { font-size: 18px; font-weight: 700; }
.ap-card p { color: var(--muted); font-size: 15px; }
a.ap-card { color: var(--ink); }
a.ap-card:hover { border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); }
.ap-card-cta { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 14px; color: var(--violet); }
.ap-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: var(--r); border: 1.5px solid var(--ink);
	background: var(--lilac-2); color: var(--ink);
}
.ap-icon svg { width: 24px; height: 24px; }
.ap-icon.lemon { background: var(--lemon); }
.ap-icon.coral { background: var(--coral); }
.ap-icon.violet { background: var(--violet); color: #FFFFFF; }
.ap-tag {
	display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-sm);
	font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink); background: var(--lemon); color: var(--ink);
}

/* ---- Поля формы -------------------------------------------------------- */
.ap-field { display: flex; flex-direction: column; gap: 6px; }
.ap-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ap-input, .ap select, .ap input[type="text"], .ap input[type="number"], .ap input[type="datetime-local"], .ap input[type="date"], .ap input[type="time"] {
	width: 100%; min-height: 42px; padding: 8px 12px;
	font: 500 15px/1.3 var(--font); color: var(--ink);
	background: #FFFFFF; border: 1.5px solid var(--line-strong); border-radius: var(--r);
	transition: border-color .15s, box-shadow .15s;
}
.ap select:hover, .ap input[type="text"]:hover, .ap input[type="number"]:hover, .ap input[type="datetime-local"]:hover, .ap input[type="date"]:hover, .ap input[type="time"]:hover { border-color: var(--muted); }
.ap select:focus, .ap input[type="text"]:focus, .ap input[type="number"]:focus, .ap input[type="datetime-local"]:focus, .ap input[type="date"]:focus, .ap input[type="time"]:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgb(164 0 255 / 0.18); }
.ap input[type="checkbox"], .ap input[type="radio"] { accent-color: var(--violet); width: 18px; height: 18px; }
.ap input[type="range"] { accent-color: var(--violet); }

/* ---- Подвал ------------------------------------------------------------ */
.ap-footer { background: #FFFFFF; border-top: 1.5px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }
.ap-footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.ap-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ap-footer a { color: var(--ink-2); font-weight: 600; }
.ap-footer a:hover { color: var(--violet); }

/* ---- Игры и симуляторы: общие детали ---------------------------------- */
/* Панель игры: назад, название, счёт. Стоит под общей шапкой или вместо неё. */
.ap-gamebar {
	position: sticky; top: 0; z-index: 40;
	background: #FFFFFF; border-bottom: 2px solid var(--ink);
}
.ap-gamebar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.ap-gamebar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ap-back {
	display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
	border-radius: var(--r); border: 1.5px solid var(--line-strong); background: #FFFFFF;
	color: var(--ink) !important; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.ap-back:hover { border-color: var(--ink); background: var(--lilac); }
.ap-gamebar-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.ap-gamebar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px;
	border-radius: var(--r); border: 1.5px solid var(--ink); background: #FFFFFF;
	font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.ap-chip b, .ap-chip .val { font-weight: 800; color: var(--ink); }
.ap-chip.lemon { background: var(--lemon); }
.ap-chip.violet { background: var(--violet); color: #FFFFFF; }
.ap-chip.violet b, .ap-chip.violet .val { color: #FFFFFF; }

.ap-progress { height: 8px; border-radius: 9999px; background: var(--lilac-2); border: 1.5px solid var(--ink); overflow: hidden; }
.ap-progress > * { height: 100%; background: var(--violet); transition: width .4s var(--ease); }

/* Ночная рамка для карты неба: сама карта остаётся тёмной. */
.ap-sky {
	position: relative; overflow: hidden; border-radius: var(--r-lg);
	border: 2px solid var(--ink); box-shadow: var(--shadow-hard);
	background: #07051A; color: #FFFFFF;
}
.ap-sky img, .ap-sky canvas { display: block; width: 100%; height: auto; }

/* Варианты ответа. */
.ap-option {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 12px 16px;
	text-align: left; cursor: pointer; border-radius: var(--r);
	font: 600 16px/1.3 var(--font); color: var(--ink);
	background: #FFFFFF; border: 1.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
	transition: background-color .15s, transform .15s var(--ease), box-shadow .15s var(--ease);
}
.ap-option:hover:not(:disabled) { background: var(--lilac); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.ap-option:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.ap-option:disabled { cursor: default; }
.ap-option.is-correct { background: var(--ok-bg); border-color: var(--ok); box-shadow: 2px 2px 0 var(--ok); color: var(--ok); }
.ap-option.is-wrong { background: var(--bad-bg); border-color: var(--bad); box-shadow: 2px 2px 0 var(--bad); color: var(--bad); }
.ap-key {
	flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
	border-radius: var(--r-sm); border: 1.5px solid var(--ink); background: var(--lilac-2); font-size: 13px; font-weight: 800;
}

/* Сообщение о результате ответа. */
.ap-feedback { padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; }
.ap-feedback.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.ap-feedback.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }

/* Экран итогов / модальное окно. */
.ap-panel { background: #FFFFFF; border: 2px solid var(--ink); border-radius: var(--r-lg); box-shadow: 4px 4px 0 var(--ink); padding: 24px; }
.ap-backdrop { position: fixed; inset: 0; background: rgb(13 11 16 / 0.55); }
.ap-stat { padding: 12px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--paper); text-align: center; }
.ap-stat b { display: block; font-size: 24px; font-weight: 800; color: var(--ink); }
.ap-stat span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Сегментированный выбор (сложность, режим). */
.ap-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ap-seg > button, .ap-seg > label {
	min-height: 38px; padding: 6px 14px; border-radius: var(--r); cursor: pointer;
	font: 600 14px var(--font); color: var(--ink); background: #FFFFFF; border: 1.5px solid var(--line-strong);
}
.ap-seg > button:hover, .ap-seg > label:hover { border-color: var(--ink); }
.ap-seg > .active, .ap-seg > [aria-pressed="true"], .ap-seg > label:has(input:checked) { background: var(--lemon); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
