/* ============================================================
   aiquests/aiquests.css — стили подсистемы «Игровые курсы».
   Использует токены дизайн-системы (--paper-*, --ink-*, --signal,
   --font-*, --s-*, --t-*). Префикс классов: aiq-.
   ============================================================ */
.aiq-btn { appearance: none; cursor: pointer; font-family: var(--font-mono); font-size: var(--t-meta); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border: 2px solid var(--ink-100); padding: 10px 16px; background: var(--paper-00); color: var(--ink-100); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: all 90ms cubic-bezier(0.2,0,0,1); }
.aiq-btn:hover { box-shadow: var(--shadow-tap); transform: translate(-1px,-1px); }
.aiq-btn--ink { background: var(--ink-100); color: var(--paper-00); }
.aiq-btn--signal { background: var(--signal); border-color: var(--signal); color: #fff; }
.aiq-btn--sm { padding: 5px 10px; font-size: var(--t-micro); }

/* ---- уровень-циферблат ---- */
.aiq-dial { position: relative; flex: none; }
.aiq-dial__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 0; }
.aiq-dial__num { font-family: var(--font-slab); font-weight: 700; font-size: 44px; line-height: 1; }
.aiq-dial__lv, .aiq-dial__of { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }

/* ---- герой ---- */
.aiq-hero { display: flex; gap: var(--s-7); align-items: center; border: 2px solid var(--ink-100); background: var(--paper-00); padding: var(--s-6); margin-bottom: var(--s-7); }
.aiq-hero__main { flex: 1; display: grid; gap: var(--s-5); }
.aiq-hero__row { display: flex; gap: var(--s-7); align-items: center; flex-wrap: wrap; }
.aiq-hero__stat { display: grid; gap: 2px; }
.aiq-hero__num { font-family: var(--font-slab); font-weight: 700; font-size: var(--t-h2); line-height: 1; }

/* ---- XP-бар ---- */
.aiq-xp { display: grid; gap: 6px; }
.aiq-xp__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); }
.aiq-xp__num { font-family: var(--font-slab); font-weight: 700; font-size: var(--t-h2); line-height: 1; }
.aiq-xp__track { height: 14px; background: var(--paper-20); border: 1px solid var(--ink-100); }
.aiq-xp__track i { display: block; height: 100%; background: var(--signal); }
.aiq-xp__foot { font-size: var(--t-micro); color: var(--text-muted); }

/* ---- штамп ---- */
.aiq-stamp { display: inline-block; flex: none; font-family: var(--font-mono); font-size: var(--t-micro); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ok, #1F8A5B); border: 2px solid currentColor; padding: 2px 8px; transform: rotate(-4deg); white-space: nowrap; }
.aiq-stamp--lg { font-size: var(--t-h3); padding: 6px 18px; transform: rotate(-7deg); }

/* ---- стрик ---- */
.aiq-streak { display: flex; align-items: center; gap: 10px; }
.aiq-streak__num { font-family: var(--font-slab); font-weight: 700; font-size: var(--t-h1); line-height: 0.9; }
.aiq-streak--compact { border: 2px solid var(--ink-100); padding: 6px 12px; background: var(--paper-00); }
.aiq-streak--compact .aiq-streak__num { font-size: var(--t-h3); }

/* ---- квесты дня ---- */
.aiq-daily { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-7); }
.aiq-day { border: 1px solid var(--ink-100); background: var(--paper-00); padding: var(--s-4); display: grid; gap: 10px; }
.aiq-day--ready { border: 2px solid var(--signal); }
.aiq-day--claimed { opacity: 0.65; }
.aiq-day__top { display: flex; align-items: center; gap: 8px; }
.aiq-day__label { font-weight: 600; font-size: var(--t-small); }
.aiq-day__bonus { margin-left: auto; color: var(--signal); font-weight: 700; }
.aiq-day__bar { height: 8px; background: var(--paper-20); border: 1px solid var(--ink-40); }
.aiq-day__bar i { display: block; height: 100%; background: var(--signal); }
.aiq-day__foot { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }

/* ---- книга актов ---- */
.aiq-book { display: grid; gap: var(--s-3); margin-bottom: var(--s-7); }
.aiq-chapter { border: 1px solid var(--ink-100); background: var(--paper-00); }
.aiq-chapter--open { border-width: 2px; }
.aiq-chapter--done { background: color-mix(in oklab, var(--paper-00) 92%, var(--signal)); }
.aiq-chapter__head { width: 100%; appearance: none; border: none; background: none; cursor: pointer; display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-5); font-family: inherit; color: inherit; text-align: left; }
.aiq-chapter__roman { font-family: var(--font-slab); font-weight: 700; font-size: var(--t-h3); width: 44px; flex: none; }
.aiq-chapter__title { font-weight: 600; font-size: var(--t-small); flex: 1; }
.aiq-chapter__meta { color: var(--text-muted); font-size: var(--t-micro); }
.aiq-chapter__bar { height: 4px; background: var(--paper-20); }
.aiq-chapter__bar i { display: block; height: 100%; background: var(--ink-100); }
.aiq-chapter__body { display: grid; padding: var(--s-2) var(--s-3) var(--s-4); gap: 2px; }

.aiq-quest { display: flex; align-items: center; gap: var(--s-3); padding: 8px var(--s-3); cursor: pointer; border-radius: 2px; }
.aiq-quest:hover { background: var(--paper-10); }
.aiq-quest__num { width: 30px; flex: none; color: var(--text-faint); font-size: var(--t-micro); text-align: right; }
.aiq-quest__badge { width: 24px; height: 24px; flex: none; border: 1px solid var(--ink-100); display: grid; place-items: center; }
.aiq-quest__title { flex: 1; font-size: var(--t-small); }
.aiq-quest__xp { color: var(--text-muted); font-size: var(--t-micro); }
.aiq-quest--locked { opacity: 0.5; }
.aiq-quest--locked .aiq-quest__badge { border-style: dashed; border-color: var(--ink-40); }
.aiq-quest--done .aiq-quest__badge { background: var(--ink-100); color: var(--paper-00); }
.aiq-quest--done .aiq-quest__title { text-decoration: line-through; text-decoration-color: var(--ink-40); color: var(--text-muted); }
.aiq-quest--boss .aiq-quest__badge { border-width: 2px; border-color: var(--signal); color: var(--signal); }
.aiq-quest--boss .aiq-quest__title { font-weight: 700; }

/* ---- трофеи ---- */
.aiq-trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-7); }
.aiq-trophy { border: 1px solid var(--ink-100); background: var(--paper-00); padding: var(--s-4); display: grid; gap: 6px; justify-items: center; text-align: center; }
.aiq-trophy__disc { width: 46px; height: 46px; border-radius: 999px; border: 2px solid var(--ink-100); display: grid; place-items: center; background: var(--signal); color: #fff; }
.aiq-trophy__name { font-weight: 700; font-size: var(--t-small); }
.aiq-trophy__desc { font-size: var(--t-micro); color: var(--text-muted); }
.aiq-trophy__date { font-size: var(--t-micro); color: var(--text-faint); }
.aiq-trophy--ghost { border-style: dashed; border-color: var(--ink-40); }
.aiq-trophy--ghost .aiq-trophy__disc { background: var(--paper-10); color: var(--text-faint); border-style: dashed; border-color: var(--ink-40); }
.aiq-trophy--ghost .aiq-trophy__name { color: var(--text-muted); }

/* ---- модалка квеста ---- */
.aiq-overlay { position: fixed; inset: 0; z-index: 300; background: color-mix(in oklab, var(--ink-100) 42%, transparent); display: grid; place-items: center; padding: var(--s-6); }
.aiq-modal { width: min(560px, 100%); max-height: 86vh; overflow: auto; background: var(--paper-00); border: 2px solid var(--ink-100); box-shadow: var(--shadow-tap); }
.aiq-modal__bar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink-40); padding: var(--s-3) var(--s-5); }
.aiq-modal__x { appearance: none; background: none; border: 1px solid var(--ink-100); padding: 5px; cursor: pointer; color: var(--ink-100); }
.aiq-modal__x:hover { background: var(--ink-100); color: var(--paper-00); }
.aiq-modal__body { padding: var(--s-6); display: grid; gap: var(--s-4); justify-items: start; }
.aiq-modal__title { font-family: var(--font-slab); font-weight: 700; font-size: var(--t-h2); line-height: 1.1; margin: 0; }
.aiq-modal__desc { color: var(--text-secondary); line-height: 1.55; margin: 0; max-width: 56ch; }
.aiq-quiz__kicker { font-size: var(--t-micro); letter-spacing: 0.2em; color: var(--signal); font-weight: 700; }

@media (max-width: 900px) {
  .aiq-hero { flex-direction: column; align-items: flex-start; }
  .aiq-chapter__meta { display: none; }
}
