/* Went Read: «Свет на тёмном» (docs/STYLE.md, полный гайд english-status/STYLE.md). Карточки сплошные,
   текст #cdd6d3 (не белый), цвета навыков везде одни, постоянные анимации только transform и opacity */
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-Bold.woff2') format('woff2'); font-weight: 700 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0b1012;
  --card: #152024;
  --card-hi: #1b282d;
  --line: #26353c;
  --line-hi: #34474f;
  --fg: #cdd6d3;
  --mut: #93a39e;
  --dim: #5f706b;
  --ac: #3fdc7e;
  --ac-rgb: 63, 220, 126;
  --gold: #ffd666;
  --learn: #f2c14e;
  --bad: #e5645d;
  --r: #9b8cff; --r-rgb: 155, 140, 255;
  --s: #ff5fa8; --s-rgb: 255, 95, 168;
  --w: #ffd23f; --w-rgb: 255, 210, 63;
  --l: #3fc4ff; --l-rgb: 63, 196, 255;
  --font: 'Montserrat', system-ui, sans-serif;
  --num: 'Poppins', 'Montserrat', sans-serif;
  --rad: 18px;
  --pop: cubic-bezier(0.2, 1.5, 0.4, 1);
  --fill: cubic-bezier(0.22, 0.9, 0.25, 1);
  --w-max: 760px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--fg);
  font: 500 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  background: var(--bg);
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, p { margin: 0; }
.muted { color: var(--mut); }
.cap { font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* clip: лучи кольца дня (::before с отступом -42%) не должны раздвигать экран телефона вбок */
#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; overflow-x: clip; }
#layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

/* ---- экраны и появление по очереди ---- */
.screen { width: 100%; max-width: var(--w-max); margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.screen.enter { animation: scrIn 0.32s ease-out both; }
.screen.enter-back { animation: scrIn 0.25s ease-out both; }
@keyframes scrIn { from { opacity: 0; transform: translateY(6px); } }
.pop { animation: pop 0.6s var(--pop) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }

/* ---- загрузка: три точки R, S, W по очереди ---- */
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
.loading i { width: 10px; height: 10px; border-radius: 50%; background: var(--r); opacity: 0.25; animation: dot 0.9s ease-in-out infinite; }
.loading i:nth-child(2) { background: var(--s); animation-delay: 0.3s; }
.loading i:nth-child(3) { background: var(--w); animation-delay: 0.6s; }
@keyframes dot { 40% { opacity: 1; transform: scale(1.25); } }

/* ---- знак: три дуги и рыбка ><> ---- */
.logo { position: relative; display: inline-flex; flex: none; }
.logo-svg { display: block; overflow: visible; }
.lg-arc { fill: none; stroke: rgb(var(--rgb)); stroke-width: 5.5; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(var(--rgb), 0.55)); }
.lg-fish { font: 800 14px var(--num); fill: var(--fg); }
/* без transform-origin: он сдвинул бы поворот из атрибута transform="rotate(.. 32 32)" */
.logo.anim .lg-arc { stroke-dashoffset: 96; animation: arcIn 0.9s var(--fill) both; animation-delay: calc(var(--i) * 110ms + 0.1s); }
.logo.anim .lg-fish { animation: fishIn 0.6s ease-out 0.6s both; }
@keyframes arcIn { from { stroke-dashoffset: 96; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes fishIn { from { opacity: 0; } }
/* свет за знаком на экране входа */
.welcome .logo::before { content: ''; position: absolute; inset: -30%; z-index: -1; border-radius: 50%; opacity: 0.32; filter: blur(26px);
  background: conic-gradient(var(--r), var(--s), var(--w), var(--r)); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ---- кнопки ---- */
.btn-main {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 15.5px; color: #fff;
  background: linear-gradient(90deg, var(--r), var(--s), var(--w)) border-box;
  transition: transform 0.2s;
}
/* кнопка с анимацией появления = свой слой, поэтому заливка отдельным ::after поверх свечения ::before, под текстом */
.btn-main::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--card); }
.btn-main::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit; filter: blur(9px); opacity: 0.35;
  background: linear-gradient(90deg, var(--r), var(--s), var(--w)); animation: breathe 2.4s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: 0.75; } }
.btn-main:active { transform: scale(0.97); }
.btn-main:disabled { opacity: 0.6; }
.btn-quiet { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card-hi); color: var(--fg); font-weight: 600; }
.btn-quiet:active { transform: scale(0.98); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 0;
  background: transparent; color: var(--mut); }
.icon-btn:active { background: var(--card-hi); }

/* ---- вход ---- */
.welcome { position: relative; display: flex; flex-direction: column; min-height: calc(100dvh - 40px); }
.langs { align-self: flex-end; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.langs button { min-width: 44px; min-height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.langs button.on { background: var(--card-hi); color: var(--fg); }
.wl-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 12px 0 8px; }
.wl-title { font: 800 36px/1.05 var(--num); letter-spacing: 0.01em; color: #fff; text-shadow: 0 0 22px rgba(155, 140, 255, 0.3); animation: pop 0.7s var(--pop) 0.35s both; }
.wl-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 360px; text-align: left; }
.wl-lines li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: baseline; color: var(--mut); font-size: 14.5px;
  animation: pop 0.6s var(--pop) both; animation-delay: calc(var(--i) * 100ms + 0.55s); }
.wl-lines li i { width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.wl-lines .sk-r i { background: var(--r); box-shadow: 0 0 10px var(--r); }
.wl-lines .sk-s i { background: var(--s); box-shadow: 0 0 10px var(--s); }
.wl-lines .sk-w i { background: var(--w); box-shadow: 0 0 10px var(--w); }
.welcome .btn-main { margin-top: 6px; animation: pop 0.6s var(--pop) 0.9s both; }
.wl-small { font-size: 12px; color: var(--dim); }
.wl-err { max-width: 340px; color: var(--fg); font-size: 15px; }
.wl-link { color: var(--mut); font-size: 13px; }
.boot-fail { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; font-size: 16px; }

/* ---- шапка ---- */
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 10px; }
.top > * { flex: none; }
.top .only-phone { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-t { font: 800 18px var(--num); color: #fff; letter-spacing: 0.01em; }
.top-t { font: 800 20px var(--num); color: #fff; }

/* ---- главная ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 4px 0 16px; }
.hello { margin: 4px 0 6px; font: 800 26px/1.15 var(--num); color: #fff; overflow-wrap: anywhere; }
.hero-txt p { font-size: 13px; max-width: 300px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-bottom: 20px; }
.wc { position: relative; padding: 16px 18px 15px; }
.wc + .wc::before { content: ''; position: absolute; left: 0; top: 16%; bottom: 16%; width: 1px; background: linear-gradient(to bottom, transparent, var(--line-hi), transparent); }
.wc-num { display: block; margin-top: 6px; font: 800 34px/1 var(--num); font-variant-numeric: tabular-nums; color: rgb(var(--rgb));
  text-shadow: 0 0 22px rgba(var(--rgb), 0.35); }
.wc-note { grid-column: 1 / -1; padding: 0 18px 14px; font-size: 12px; color: var(--dim); }
.sec-cap { margin: 0 2px 10px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 14px 14px 12px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.tile::after { content: ''; position: absolute; inset: auto -20% -60% 30%; height: 90%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--rgb), 0.16), transparent); pointer-events: none; }
.tile-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; margin-bottom: 6px;
  color: rgb(var(--rgb)); background: rgba(var(--rgb), 0.12); box-shadow: inset 0 0 0 1px rgba(var(--rgb), 0.22); }
.tile-t { font-weight: 700; font-size: 15px; color: var(--fg); }
.tile-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

/* ---- кольцо дня (как english-status, три дуги) ---- */
.dr { position: relative; isolation: isolate; width: 132px; aspect-ratio: 1; }
.dr::before { content: ''; position: absolute; z-index: -1; inset: -42%; border-radius: 50%; opacity: 0; transition: opacity 0.8s;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.09) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 24%, transparent 62%); mask: radial-gradient(circle, #000 24%, transparent 62%); }
.dr.all::before { opacity: 1; animation: spin 60s linear infinite; }
.dr-glow { position: absolute; z-index: -1; inset: 6%; border-radius: 50%; background: radial-gradient(circle, rgba(155, 140, 255, 0.1), transparent 66%); }
.dr.all .dr-glow { background: radial-gradient(circle, rgba(63, 220, 126, 0.3), transparent 66%); animation: drBreath 3s ease-in-out infinite alternate; }
@keyframes drBreath { from { opacity: 0.55; } to { opacity: 1; } }
.dr-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dr-track { fill: none; stroke: rgba(var(--rgb), 0.16); stroke-width: 13; stroke-linecap: round; }
.dr-fill { fill: none; stroke: rgb(var(--rgb)); stroke-width: 13; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(var(--rgb), 0.8)); }
.dr-fill.ok { stroke-width: 15; filter: drop-shadow(0 0 8px rgb(var(--rgb))); }
.dr-fill.zero { opacity: 0; }
.dr-track, .dr-fill { transition: stroke-width 0.2s, stroke 0.2s, stroke-dasharray 1.2s var(--fill); }
.dr-track.hot { stroke-width: 17; stroke: rgba(var(--rgb), 0.32); }
.dr-fill.hot { stroke-width: 17; }
.dr-hit { fill: none; stroke: transparent; stroke-width: 36; pointer-events: stroke; cursor: pointer; }
.dr-check { fill: none; stroke: #fff; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  filter: drop-shadow(0 0 7px rgba(63, 220, 126, 0.9)); }
.dr.all .dr-check { opacity: 1; animation: draw 0.6s cubic-bezier(0.65, 0, 0.25, 1) 0.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.dr-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; transition: opacity 0.4s; }
.dr.all .dr-mid { opacity: 0; }
.dr-num b { font: 800 32px/1 var(--num); color: #fff; font-variant-numeric: tabular-nums; }
.dr-num small { margin-left: 3px; font-size: 11px; font-weight: 700; color: var(--mut); }
.dr-of { margin-top: 4px; font-size: 10.5px; color: var(--mut); }
.dr-tip { position: fixed; min-width: 168px; padding: 10px 12px 9px; border-radius: 12px; font-size: 12px; color: var(--fg); pointer-events: none;
  background: var(--card); border: 1px solid rgba(var(--rgb), 0.55); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 24px -6px rgba(var(--rgb), 0.6);
  opacity: 0; transform: translateY(4px) scale(0.97); transition: opacity 0.15s, transform 0.15s; }
.dr-tip.on { opacity: 1; transform: none; }
.dr-tip b { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--rgb)); text-shadow: 0 0 10px rgba(var(--rgb), 0.5); }
.tt-bar { height: 5px; margin-bottom: 7px; border-radius: 99px; background: rgba(var(--rgb), 0.15); overflow: hidden; }
.tt-bar i { display: block; height: 100%; background: rgb(var(--rgb)); box-shadow: 0 0 8px rgba(var(--rgb), 0.8); }
.tt-st { margin-top: 2px; font-weight: 700; color: rgb(var(--rgb)); }

/* ---- настройки ---- */
.sgroup { margin-bottom: 18px; }
.sgroup > .cap { margin: 0 4px 8px; }
.sgroup .card { padding: 6px 16px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 0; }
.srow + .srow { border-top: 1px solid var(--line); }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); flex: none; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--mut); font-weight: 700; font-size: 13px; }
.seg button.on { background: var(--card-hi); color: #fff; box-shadow: inset 0 0 0 1px var(--line-hi); }
.acct { justify-content: flex-start; }
.face { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover; }
.face-letter { display: inline-flex; align-items: center; justify-content: center; font: 800 18px var(--num); color: #fff;
  background: linear-gradient(135deg, rgba(155, 140, 255, 0.5), rgba(255, 95, 168, 0.4)); }
.who { display: flex; flex-direction: column; min-width: 0; }
.who b { color: #fff; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.snote { padding: 2px 0 12px; font-size: 12px; color: var(--dim); }
.settings .btn-quiet { margin: 0 0 12px; }

/* ---- всплывашка ---- */
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--card-hi); border: 1px solid var(--line-hi); color: var(--fg); font-size: 13.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translate(-50%, 8px); transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- меню слева: только компьютер ---- */
#side { display: none; }
@media (min-width: 1000px) {
  body.in #side {
    position: fixed; z-index: 2; left: 0; top: 0; bottom: 0; width: 232px; display: flex; flex-direction: column; gap: 6px;
    padding: 22px 14px 18px; background: var(--card); border-right: 1px solid var(--line);
  }
  body.in #app { margin-left: 232px; }
  body.in .only-phone { display: none; }
  body.in .home .brand { visibility: hidden; } /* знак уже в меню слева */
  .screen { padding-top: 28px; }
  .sd-logo { display: flex; align-items: center; gap: 10px; margin: 0 6px 18px; padding: 0; border: 0; background: none; font: 800 18px var(--num); color: #fff; }
  .sd-nav { display: flex; flex-direction: column; gap: 2px; }
  .sd-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--mut); font-weight: 600; text-align: left; }
  .sd-item.on { background: var(--card-hi); color: #fff; box-shadow: inset 0 0 0 1px var(--line-hi); }
  .sd-grow { flex: 1; }
  .sd-card { padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
  .sd-name { display: block; margin-bottom: 8px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sd-row { display: flex; justify-content: space-between; align-items: baseline; color: var(--mut); font-size: 12.5px; }
  .sd-k { font: 800 18px var(--num); color: var(--ac); font-variant-numeric: tabular-nums; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dr { width: 150px; }
  .hello { font-size: 30px; }
}
@media (hover: hover) and (pointer: fine) {
  .sd-item:hover:not(.on) { background: var(--card-hi); color: var(--fg); }
  .icon-btn:hover { color: var(--fg); background: var(--card-hi); }
  .btn-quiet:hover { border-color: var(--line-hi); }
  .btn-main:hover { transform: translateY(-1px); }
}

/* узкий телефон: кольцо меньше */
@media (max-width: 370px) {
  .dr { width: 112px; }
  .hello { font-size: 22px; }
  .wc-num { font-size: 30px; }
}
/* низкий экран входа (телефон горизонтально) */
@media (max-height: 560px) {
  .wl-mid { gap: 12px; }
  .wl-title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  .loading i { opacity: 0.8; }
}
