/* ЗАВЕТ — тёмное фэнтези: обугленный камень, тлеющий янтарь, холодная кость.
   Никаких внешних шрифтов: system-ui грузится мгновенно и не тянет CDN. */

:root {
  --bg:        #0b0908;
  --bg-2:      #14100d;
  --panel:     rgba(28, 22, 18, .72);
  --panel-2:   rgba(40, 31, 25, .55);
  --line:      rgba(201, 138, 75, .18);
  --line-hot:  rgba(230, 150, 70, .45);

  --ink:       #e8ddd0;
  --ink-dim:   #9a8b7c;
  --ink-faint: #6b5f55;

  --ember:     #e0913f;
  --ember-hot: #ffc46b;
  --blood:     #b4423a;
  --bone:      #d8cbb6;
  --frost:     #7fb6d6;
  --void:      #a583d6;

  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Собственный display у .boot/.modal/.screen перебил бы стандартное
   [hidden] { display: none }. Возвращаем атрибуту силу. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}

body::before {                       /* тлеющее свечение снизу */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 60% at 50% 108%, rgba(224,145,63,.16), transparent 62%),
    radial-gradient(90% 50% at 50% -10%, rgba(120,90,180,.10), transparent 60%);
}

#app { position: relative; z-index: 1; padding-bottom: calc(64px + var(--safe-b)); }

/* ─────────────── Загрузка ─────────────── */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 14px;
  justify-items: center; z-index: 50; background: var(--bg);
}
.boot-mark {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--line-hot);
  box-shadow: 0 0 40px rgba(224,145,63,.35), inset 0 0 24px rgba(224,145,63,.2);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .7 }
                   50% { transform: scale(1.12); opacity: 1 } }
.boot-title { font-size: 30px; letter-spacing: .5em; color: var(--bone);
              text-indent: .5em; font-weight: 300; }
.boot-sub { color: var(--ink-faint); font-size: 13px; letter-spacing: .1em; }

/* ─────────────── Общее ─────────────── */
.screen { padding: 12px 16px 24px; }
.scr-title { font-size: 20px; font-weight: 400; letter-spacing: .18em;
             color: var(--bone); margin: 8px 0 16px; text-transform: uppercase; }
.scr-sub { font-size: 12px; letter-spacing: .18em; color: var(--ink-faint);
           text-transform: uppercase; margin: 24px 0 10px; font-weight: 500; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start;
          padding: 4px 0 10px; }
.tb-name { font-size: 15px; color: var(--bone); }
.tb-region { font-size: 12px; color: var(--ink-faint); letter-spacing: .06em; }
.streak { display: flex; align-items: center; gap: 5px; font-size: 15px;
          color: var(--ember-hot); }
.streak .flame { filter: drop-shadow(0 0 6px rgba(255,196,107,.8)); }
.streak.cold { color: var(--ink-faint); }
.streak.cold .flame { filter: none; }

.xpbar { position: relative; height: 3px; background: rgba(255,255,255,.06);
         border-radius: 2px; margin-bottom: 16px; }
.xpbar-fill { height: 100%; border-radius: 2px;
              background: linear-gradient(90deg, var(--ember), var(--ember-hot));
              transition: width .6s cubic-bezier(.2,.8,.2,1); }
.xpbar-label { position: absolute; right: 0; top: 6px; font-size: 10px;
               letter-spacing: .14em; color: var(--ink-faint); }

/* ─────────────── Босс ─────────────── */
.boss-stage {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel), rgba(15,12,10,.9));
  padding: 18px 16px 16px; overflow: hidden;
}
.boss-stage::after {                 /* виньетка */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 60% at 50% 30%, transparent, rgba(0,0,0,.55));
}
.boss-art {
  height: 168px; margin: -6px -16px 12px; background-size: cover;
  background-position: center 28%;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
          mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.boss-art.empty { display: none; }
.boss-name { font-size: 22px; letter-spacing: .1em; color: var(--bone);
             position: relative; }
.boss-mech { font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
             color: var(--blood); margin-top: 3px; min-height: 14px; position: relative; }

.hpbar { position: relative; height: 22px; margin: 14px 0 4px;
         background: rgba(0,0,0,.5); border: 1px solid var(--line);
         border-radius: 4px; overflow: hidden; }
.hpbar-ghost { position: absolute; inset: 0 auto 0 0; background: rgba(180,66,58,.28);
               transition: width 1.1s ease .25s; }
.hpbar-fill { position: absolute; inset: 0 auto 0 0; z-index: 1;
              background: linear-gradient(90deg, #7d211c, var(--blood));
              box-shadow: 0 0 18px rgba(180,66,58,.5);
              transition: width .5s cubic-bezier(.2,.8,.2,1); }
.hpbar-label { position: absolute; inset: 0; z-index: 2; display: grid;
               place-content: center; font-size: 11px; letter-spacing: .1em;
               color: var(--bone); text-shadow: 0 1px 3px #000; }
.boss-timer { font-size: 11px; letter-spacing: .12em; color: var(--ember);
              position: relative; min-height: 14px; }
.boss-timer.urgent { color: var(--blood); }
.boss-intro { font-size: 13px; color: var(--ink-dim); font-style: italic;
              margin: 10px 0 0; position: relative; }

/* ─────────────── Сводка дня ─────────────── */
.today-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
               margin: 14px 0; }
.today-strip div { background: var(--panel-2); border: 1px solid var(--line);
                   border-radius: 10px; padding: 9px 6px; text-align: center; }
.today-strip b { display: block; font-size: 17px; color: var(--bone);
                 font-weight: 500; }
.today-strip span { font-size: 10px; letter-spacing: .08em; color: var(--ink-faint); }
.today-strip div.met { border-color: var(--line-hot);
                       box-shadow: 0 0 16px rgba(224,145,63,.14) inset; }

/* ─────────────── Кнопки ─────────────── */
.btn-primary, .btn-ghost, .btn-danger {
  font: inherit; border-radius: 12px; cursor: pointer;
  transition: transform .12s, filter .2s;
}
.btn-primary:active, .btn-ghost:active, .btn-danger:active { transform: scale(.975); }

.btn-primary {
  width: 100%; border: 1px solid var(--line-hot); color: #150f09;
  background: linear-gradient(180deg, var(--ember-hot), var(--ember));
  padding: 14px; font-weight: 600;
  box-shadow: 0 6px 28px rgba(224,145,63,.28);
}
.btn-primary.big { display: grid; gap: 2px; padding: 16px; }
.btn-kicker { font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
              opacity: .65; font-weight: 600; }
.btn-main { font-size: 19px; letter-spacing: .16em; font-weight: 700; }

.btn-ghost { flex: 1; background: transparent; border: 1px solid var(--line);
             color: var(--ink-dim); padding: 11px; font-size: 13px; }
.btn-danger { background: transparent; border: 1px solid rgba(180,66,58,.5);
              color: #d9736b; padding: 13px 20px; }
.quick-row { display: flex; gap: 8px; margin-top: 10px; }

/* ─────────────── Хроника ─────────────── */
.log { margin-top: 22px; display: grid; gap: 1px; }
.log-row { display: grid; grid-template-columns: 8px 1fr; gap: 10px;
           padding: 7px 0; border-top: 1px solid rgba(255,255,255,.04);
           font-size: 12.5px; color: var(--ink-dim); }
.log-row i { width: 5px; height: 5px; border-radius: 50%; margin-top: 6px;
             background: var(--ink-faint); font-style: normal; }
.log-row[data-k="boss"] i    { background: var(--blood); }
.log-row[data-k="set"] i     { background: var(--ember); }
.log-row[data-k="steps"] i   { background: var(--frost); }
.log-row[data-k="region"] i  { background: var(--void); }
.log-row[data-k="streak"] i  { background: var(--ember-hot); }
.log-row[data-k="security"] i{ background: #d33; }
.log-row[data-k="story"] i   { background: var(--bone); }

/* ─────────────── Тренировка ─────────────── */
[data-screen="train"] { padding: 0; }
.train-wrap { display: flex; flex-direction: column; min-height: 100dvh;
              padding: 8px 12px calc(12px + var(--safe-b)); gap: 10px; }
.cam-frame { position: relative; flex: 1; min-height: 300px; border-radius: 16px;
             overflow: hidden; background: #000; border: 1px solid var(--line); }
#cam, #overlay { position: absolute; inset: 0; width: 100%; height: 100%;
                 object-fit: cover; transform: scaleX(-1); }
#cam { filter: saturate(.55) contrast(1.05) brightness(.85); }

.privacy-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 100px;
  padding: 5px 11px; font-size: 10.5px; letter-spacing: .04em; color: var(--ink-dim);
}
.privacy-badge .dot { width: 6px; height: 6px; border-radius: 50%;
  background: #4ad07a; box-shadow: 0 0 8px #4ad07a; animation: pulse 2s infinite; }

.rep-hud { position: absolute; inset: auto 0 76px 0; z-index: 3; text-align: center;
           pointer-events: none; }
.rep-count { font-size: 84px; line-height: 1; font-weight: 200; color: #fff;
             text-shadow: 0 4px 40px rgba(0,0,0,.9), 0 0 60px rgba(224,145,63,.5);
             transition: transform .12s; }
.rep-count.hit { transform: scale(1.22); }
.rep-count.shallow { color: #d9736b; text-shadow: 0 4px 40px rgba(0,0,0,.9),
                     0 0 60px rgba(180,66,58,.6); }
.rep-hint { font-size: 12.5px; letter-spacing: .1em; color: rgba(255,255,255,.75);
            text-shadow: 0 2px 8px #000; margin-top: 4px; }

.angle-gauge { position: absolute; inset: auto 12px 14px 12px; z-index: 3; }
.gauge-track { height: 5px; background: rgba(0,0,0,.6); border-radius: 3px;
               overflow: hidden; }
.gauge-fill { height: 100%; width: 0%; border-radius: 3px;
              background: linear-gradient(90deg, var(--blood), var(--ember-hot));
              transition: width .08s linear; }
.gauge-marks { position: relative; height: 0; }
.gauge-marks i { position: absolute; left: var(--p); top: -7px; width: 1px;
                 height: 9px; background: rgba(255,255,255,.5); }
.gauge-label { text-align: right; font-size: 10px; color: rgba(255,255,255,.6);
               letter-spacing: .1em; margin-top: 4px; }

.combo-flash { position: absolute; inset: 0; z-index: 2; pointer-events: none;
               opacity: 0; background: radial-gradient(circle at 50% 60%,
               rgba(255,196,107,.35), transparent 55%); }
.combo-flash.on { animation: flash .38s ease-out; }
@keyframes flash { from { opacity: 1 } to { opacity: 0 } }

.train-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.train-stats div { background: var(--panel-2); border: 1px solid var(--line);
                   border-radius: 10px; padding: 8px; text-align: center; }
.train-stats b { display: block; font-size: 18px; color: var(--ember-hot);
                 font-weight: 500; }
.train-stats span { font-size: 10px; color: var(--ink-faint); letter-spacing: .08em; }
.train-actions { display: flex; gap: 8px; }
.train-actions .btn-primary { flex: 2; }
.train-tip { font-size: 11.5px; color: var(--ink-faint); text-align: center;
             margin: 0; line-height: 1.4; }

/* ─────────────── Карта ─────────────── */
.leagues { font-size: 13px; color: var(--ink-dim); margin-bottom: 14px; }
.leagues b { color: var(--ember-hot); font-size: 22px; font-weight: 500; }
.regions { display: grid; gap: 10px; }
.region { border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
          background: var(--panel-2); position: relative; overflow: hidden; }
.region.locked { opacity: .42; }
.region.cleared { border-color: var(--line-hot); }
.region::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
                  background: var(--rc, var(--ink-faint)); }
.region-art { position: absolute; inset: 0; background-size: cover;
              background-position: center; opacity: .38; z-index: 0;
              -webkit-mask-image: linear-gradient(90deg, #000 10%, transparent 92%);
                      mask-image: linear-gradient(90deg, #000 10%, transparent 92%); }
.region.locked .region-art { filter: grayscale(1) brightness(.5); opacity: .18; }
.region > *:not(.region-art) { position: relative; z-index: 1; }
.region h4 { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--bone);
             letter-spacing: .06em; text-shadow: 0 2px 8px #000; }
.region p { margin: 0; font-size: 12px; color: var(--ink-faint); font-style: italic; }
.region .req { font-size: 11px; color: var(--ember); margin-top: 6px;
               letter-spacing: .06em; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 68px;
         padding: 6px 0; border-bottom: 1px solid var(--line); }
.chart div { flex: 1; background: linear-gradient(180deg, var(--ember), rgba(224,145,63,.2));
             border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.chart div.today { background: linear-gradient(180deg, var(--ember-hot), var(--ember)); }

/* ─────────────── Герой ─────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
        padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 300; color: var(--bone); }
.stat span { font-size: 10px; letter-spacing: .12em; color: var(--ink-faint);
             text-transform: uppercase; }
.stat small { display: block; font-size: 10px; color: var(--ember); margin-top: 3px; }

.slots { display: grid; gap: 8px; }
.slot-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
              background: var(--panel-2); }
.slot-group > h5 { margin: 0 0 8px; font-size: 10px; letter-spacing: .16em;
                   color: var(--ink-faint); text-transform: uppercase; font-weight: 500; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
        padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
        background: rgba(0,0,0,.25); margin-bottom: 6px; cursor: pointer; }
.item:last-child { margin-bottom: 0; }
.item.on { border-color: var(--line-hot); background: rgba(224,145,63,.08); }
.item .nm { font-size: 13px; color: var(--ink); }
.item .st { font-size: 11px; color: var(--ink-faint); }
.item .rr { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.rr.common   { color: var(--ink-faint); }
.rr.uncommon { color: #7fb37f; }
.rr.rare     { color: var(--frost); }
.rr.covenant { color: var(--ember-hot); text-shadow: 0 0 10px rgba(255,196,107,.6); }
.empty-note { font-size: 12px; color: var(--ink-faint); font-style: italic; }

.skills { display: grid; gap: 8px; }
.skill { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
         background: var(--panel-2); }
.skill.locked { opacity: .5; }
.skill h5 { margin: 0 0 3px; font-size: 13.5px; font-weight: 500; color: var(--bone); }
.skill p { margin: 0; font-size: 12px; color: var(--ink-faint); }
.skill .prog { height: 2px; background: rgba(255,255,255,.07); margin-top: 8px;
               border-radius: 2px; }
.skill .prog i { display: block; height: 100%; background: var(--ember);
                 border-radius: 2px; }
.record { border: 1px solid var(--line); border-radius: 12px; padding: 14px;
          background: var(--panel-2); font-size: 13px; color: var(--ink-dim); }
.record b { color: var(--ember-hot); font-size: 20px; font-weight: 500; }

/* ─────────────── Навигация ─────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3,1fr);
  background: rgba(11,9,8,.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar button { background: none; border: 0; color: var(--ink-faint);
                 padding: 9px 0 8px; display: grid; gap: 2px; justify-items: center;
                 font: inherit; cursor: pointer; }
.tabbar i { font-style: normal; font-size: 17px; }
.tabbar span { font-size: 10px; letter-spacing: .1em; }
.tabbar button.active { color: var(--ember-hot); }
.tabbar.hidden { display: none; }

/* ─────────────── Модалка ─────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
         background: rgba(0,0,0,.72); backdrop-filter: blur(6px); padding: 24px; }
.modal-card { width: 100%; max-width: 380px; border: 1px solid var(--line-hot);
              border-radius: 16px; padding: 22px;
              background: linear-gradient(180deg, #1c1611, #0f0c0a);
              box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.modal-card h3 { margin: 0 0 4px; font-size: 20px; font-weight: 400;
                 letter-spacing: .1em; color: var(--bone); }
.modal-card .big-num { font-size: 46px; font-weight: 200; color: var(--ember-hot);
                       line-height: 1.1; margin: 8px 0; }
.modal-card ul { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 5px; }
.modal-card li { font-size: 13px; color: var(--ink-dim); display: flex;
                 justify-content: space-between; gap: 12px;
                 border-bottom: 1px solid rgba(255,255,255,.05); padding-bottom: 5px; }
.modal-card li b { color: var(--ink); font-weight: 500; }
.modal-card .story { font-size: 13px; font-style: italic; color: var(--ember);
                     margin: 12px 0; line-height: 1.5; }
.modal-card .loot { font-size: 13px; color: var(--frost); margin: 4px 0; }
.modal-card input { width: 100%; background: rgba(0,0,0,.4); border: 1px solid var(--line);
                    border-radius: 10px; padding: 12px; color: var(--ink);
                    font: inherit; margin: 10px 0; -webkit-user-select: text;
                    user-select: text; }
.modal-card .big-cap { font-size: 11px; letter-spacing: .16em; color: var(--ink-faint);
                       text-transform: uppercase; margin-top: -6px; }

/* ─────────────── Выбор цели ─────────────── */
.target-switch { display: flex; gap: 8px; margin-bottom: 10px; }
.target-switch:empty { display: none; }
.target-switch button { flex: 1; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 10px; color: var(--ink-dim); font: inherit;
  display: grid; gap: 1px; text-align: left; cursor: pointer; }
.target-switch button b { font-size: 13px; font-weight: 500; color: var(--ink-dim); }
.target-switch button span { font-size: 10px; letter-spacing: .08em; color: var(--ink-faint); }
.target-switch button.on { border-color: var(--line-hot); background: rgba(224,145,63,.09); }
.target-switch button.on b { color: var(--bone); }

/* ─────────────── Метки босса ─────────────── */
.boss-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
             position: relative; min-height: 18px; }
.boss-tags i { font-style: normal; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; border: 1px solid var(--line); border-radius: 100px;
  padding: 3px 9px; color: var(--ink-faint); }
.boss-tags i.vuln { color: var(--ember-hot); border-color: var(--line-hot); }
.boss-tags i.bad { color: var(--blood); border-color: rgba(180,66,58,.4); }

/* ─────────────── Полоса дневной нагрузки ─────────────── */
.loadbar-wrap { margin: 14px 0 12px; }
.loadbar { position: relative; height: 10px; border-radius: 5px; overflow: hidden;
           background: rgba(0,0,0,.45); border: 1px solid var(--line); display: flex; }
.loadbar i { display: block; height: 100%; transition: width .5s ease; }
.loadbar u.mark { position: absolute; top: -2px; bottom: -2px; width: 1px;
                  background: rgba(232,221,208,.55); }
.loadbar u.mark.hard { background: rgba(180,66,58,.85); }
.loadbar-legend { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
.loadbar-legend b { color: var(--bone); font-size: 13px; }
.loadbar-legend .warn { color: var(--blood); }

/* ─────────────── Выбор упражнения ─────────────── */
.ex-pick { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
           margin-bottom: 12px; }
.ex-pick .ex { position: relative; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 6px 9px; color: var(--ink-dim); font: inherit;
  display: grid; gap: 2px; cursor: pointer; text-align: center; }
.ex-pick .ex b { font-size: 13px; font-weight: 500; }
.ex-pick .ex span { font-size: 10px; color: var(--ink-faint); }
.ex-pick .ex.on { border-color: var(--line-hot); background: rgba(224,145,63,.1); }
.ex-pick .ex.on b { color: var(--ember-hot); }
.ex-pick .ex u { position: absolute; top: -7px; right: -5px; font-size: 9px;
  letter-spacing: .06em; text-decoration: none; background: var(--ember);
  color: #150f09; border-radius: 100px; padding: 2px 6px; font-weight: 700; }
.ex-pick .ex.vuln { border-color: var(--line-hot); }

.btn-ghost.armed { border-color: var(--line-hot); color: var(--ember-hot);
                   background: rgba(224,145,63,.1); }
.btn-cycle { width: 100%; margin-top: 12px; padding: 13px; font: inherit;
  border-radius: 12px; cursor: pointer; color: var(--void);
  background: rgba(165,131,214,.1); border: 1px solid rgba(165,131,214,.45); }

.ex-badge { position: absolute; top: 10px; right: 10px; z-index: 3;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px); border-radius: 100px;
  border: 1px solid rgba(255,255,255,.1); padding: 5px 11px; font-size: 10.5px;
  letter-spacing: .06em; color: var(--ink-dim); }
.rep-unit { font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
            color: rgba(255,255,255,.55); margin-top: -2px; }

/* ─────────────── Прогресс силы ─────────────── */
.strength { display: grid; gap: 10px; }
.str-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px;
             background: var(--panel-2); }
.str-block h5 { margin: 0 0 9px; font-size: 13.5px; font-weight: 500; color: var(--bone);
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.str-block h5 span { font-size: 10px; color: var(--ink-faint); font-weight: 400;
                     letter-spacing: .06em; }
.str-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { background: rgba(0,0,0,.25); border-radius: 9px; padding: 8px 10px;
          display: grid; gap: 1px; position: relative; }
.metric span { font-size: 10px; letter-spacing: .06em; color: var(--ink-faint); }
.metric b { font-size: 17px; font-weight: 500; color: var(--ink); }
.metric u { position: absolute; right: 9px; bottom: 8px; font-size: 11px;
            text-decoration: none; font-weight: 600; }
.metric u.up { color: #6fbf82; }
.metric u.down { color: #c96a62; }

/* ─────────────── Кузница ─────────────── */
.purse { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 6px; }
.purse div { background: var(--panel-2); border: 1px solid var(--line);
             border-radius: 12px; padding: 11px 8px; text-align: center; }
.purse b { display: block; font-size: 19px; font-weight: 500; color: var(--ember-hot); }
.purse span { font-size: 10px; letter-spacing: .1em; color: var(--ink-faint); }

.forge-actions { display: grid; gap: 8px; }
.forge-act { text-align: left; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; color: var(--ink); font: inherit;
  display: grid; gap: 3px; cursor: pointer; }
.forge-act b { font-size: 14px; font-weight: 500; color: var(--bone); }
.forge-act span { font-size: 11.5px; color: var(--ink-faint); }
.forge-act u { font-size: 11px; text-decoration: none; color: var(--ember);
               letter-spacing: .06em; margin-top: 3px; }
.forge-act:disabled { opacity: .4; cursor: default; }

.forge-items { display: grid; gap: 10px; }
.forge-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px;
              background: var(--panel-2); }
.forge-item .item { cursor: default; }
.forge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.forge-row button { flex: 1 1 auto; background: transparent; border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; color: var(--ink-dim); font: inherit;
  font-size: 11.5px; cursor: pointer; }
.forge-row button:disabled { opacity: .35; cursor: default; }
.forge-row button.revert { color: var(--frost); border-color: rgba(127,182,214,.35); }
.item .nm em { font-style: normal; color: var(--ember-hot); font-size: 12px; }

.tabbar { grid-template-columns: repeat(5,1fr); }
.tabbar span { font-size: 9px; }

/* ─────────────── Задание дня ─────────────── */
.quest { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
         background: var(--panel-2); margin-bottom: 12px; }
.quest.done { border-color: var(--line-hot); background: rgba(224,145,63,.07); }
.quest-head { display: flex; justify-content: space-between; align-items: baseline;
              gap: 8px; }
.quest-head b { font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
                color: var(--ink-faint); font-weight: 500; }
.quest-head span { font-size: 12px; color: var(--ember); }
.quest.done .quest-head span { color: var(--ember-hot); }
.quest p { margin: 5px 0 8px; font-size: 13px; color: var(--ink); }
.quest small { font-size: 11px; color: var(--ink-faint); }
.quest-bar { height: 3px; background: rgba(255,255,255,.07); border-radius: 2px;
             overflow: hidden; margin-bottom: 6px; }
.quest-bar i { display: block; height: 100%; border-radius: 2px;
               background: linear-gradient(90deg, var(--ember), var(--ember-hot));
               transition: width .5s ease; }

.loadbar-legend .rest { color: #7fbf94; }
.loadbar-legend .dim { color: var(--ink-faint); }

/* ─────────────── Наборы ─────────────── */
.sets { display: grid; gap: 8px; }
.set { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
       background: var(--panel-2); opacity: .55; }
.set.on { opacity: 1; border-color: var(--line-hot);
          background: rgba(224,145,63,.08); }
.set h5 { margin: 0 0 3px; font-size: 13.5px; font-weight: 500; color: var(--bone);
          display: flex; justify-content: space-between; gap: 8px; }
.set h5 span { font-size: 11px; color: var(--ink-faint); font-weight: 400; }
.set.on h5 span { color: var(--ember-hot); }
.set p { margin: 0 0 5px; font-size: 12px; color: var(--ink-dim); }
.set small { font-size: 11px; color: var(--ink-faint); }
.set small b { color: var(--ink); font-weight: 500; }

/* ─────────────── Летопись ─────────────── */
.since { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 14px; }
.since b { color: var(--bone); }

.period-tabs { display: flex; gap: 5px; margin-bottom: 12px; }
.period-tabs button { flex: 1; background: transparent; border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 2px; color: var(--ink-faint); font: inherit;
  font-size: 11.5px; cursor: pointer; }
.period-tabs button.on { border-color: var(--line-hot); color: var(--ember-hot);
                         background: rgba(224,145,63,.09); }

.ch-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.ch-cell { background: var(--panel-2); border: 1px solid var(--line);
           border-radius: 11px; padding: 11px 7px; text-align: center; }
.ch-cell b { display: block; font-size: 19px; font-weight: 500; color: var(--bone); }
.ch-cell span { font-size: 9.5px; letter-spacing: .06em; color: var(--ink-faint); }

.ch-list { margin-top: 10px; border: 1px solid var(--line); border-radius: 11px;
           background: var(--panel-2); padding: 4px 12px; }
.ch-row { display: flex; align-items: baseline; gap: 8px; padding: 8px 0;
          border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; }
.ch-row:last-child { border-bottom: 0; }
.ch-row span { flex: 1; color: var(--ink-dim); }
.ch-row b { color: var(--ember-hot); font-size: 16px; font-weight: 500; }
.ch-row u { text-decoration: none; font-size: 11px; color: var(--ink-faint); }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr);
        gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i, .heat-legend i { width: 11px; height: 11px; border-radius: 2.5px;
                          display: block; }
.heat .l0, .heat-legend .l0 { background: rgba(255,255,255,.05); }
.heat .l1, .heat-legend .l1 { background: rgba(224,145,63,.28); }
.heat .l2, .heat-legend .l2 { background: rgba(224,145,63,.5); }
.heat .l3, .heat-legend .l3 { background: rgba(224,145,63,.75); }
.heat .l4, .heat-legend .l4 { background: var(--ember-hot); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px;
               font-size: 10px; color: var(--ink-faint); }

.month-labels { display: flex; gap: 3px; margin-top: 4px; }
.month-labels span { flex: 1; text-align: center; font-size: 9px;
                     color: var(--ink-faint); }
.records { border: 1px solid var(--line); border-radius: 11px;
           background: var(--panel-2); padding: 4px 12px; }
