/* ============ Панели «инвентаря» ============ */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 2px solid var(--edge-dark);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 2px var(--edge-light),
    inset 0 -16px 26px rgba(0, 0, 0, .22),
    0 4px 0 rgba(0, 0, 0, .4),
    0 18px 40px var(--shadow);
  padding: 18px;
}
.panel::after {
  content: "";
  position: absolute;
  inset: 3px 3px auto 3px;
  height: 32%;
  border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent);
  pointer-events: none;
}
.panel > * { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  font-weight: 900;
}

/* ============ Герой ============ */
.hero-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-pixel);
  font-size: clamp(14px, 1.7vw, 18px);
  line-height: 1.6;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .85), 0 0 18px rgba(255, 215, 107, .25);
}
.hero-card p { color: var(--muted); line-height: 1.55; }
.privacy-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  border-left: 3px solid var(--sky);
  padding-left: 10px;
  line-height: 1.5;
}

/* ============ Кнопки в стиле Terraria ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 900;
  letter-spacing: .02em;
  color: #1c1503;
  text-decoration: none;
  cursor: pointer;
  padding: 11px 16px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, .55);
  background: linear-gradient(180deg, var(--btn-hi, #ffe9a8), var(--btn-md, var(--gold)) 55%, var(--btn-lo, #c9932f));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 0 rgba(0, 0, 0, .22),
    0 4px 0 rgba(0, 0, 0, .45),
    0 10px 22px rgba(0, 0, 0, .35);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 rgba(0, 0, 0, .45);
}
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn--steam { --btn-hi: #b7e9ff; --btn-md: var(--steam); --btn-lo: #2e7cab; color: #06131f; }
.btn--gold { color: #241a02; }
.btn--big { width: 100%; margin-top: 10px; padding: 14px; }
.full { width: 100%; }
.steam-dot { font-size: 11px; }

/* ============ Формы ============ */
label {
  display: grid;
  gap: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
input, select {
  width: 100%;
  background: rgba(4, 6, 16, .85);
  color: var(--text);
  border: 2px solid var(--edge-dark);
  box-shadow: inset 0 0 0 1px var(--edge-light), inset 0 3px 8px rgba(0, 0, 0, .5);
  padding: 10px 12px;
  border-radius: 6px;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--sky);
  box-shadow: inset 0 0 0 1px var(--edge-light), 0 0 0 3px rgba(127, 209, 247, .2);
}
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.filter-grid .filter-wide { grid-column: 1 / -1; }

/* ============ Полосы прогресса (жизнь/мана) ============ */
.meter-block { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.meter-head strong { color: var(--text); font-variant-numeric: tabular-nums; }
.meter {
  height: 18px;
  padding: 3px;
  border-radius: 6px;
  background: #04060f;
  border: 2px solid var(--edge-dark);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8), inset 0 0 0 1px var(--edge-light);
}
.meter span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .18) 0 2px, transparent 2px 10px),
    linear-gradient(180deg, rgba(255, 255, 255, .38), transparent 46%),
    var(--meter-color, var(--green));
  box-shadow: 0 0 10px var(--meter-color, var(--green));
  transition: width .45s ease;
}
.meter--steam span { --meter-color: var(--green); }
.meter--guide span { --meter-color: var(--sky); }
.sync-line { color: var(--muted); font-size: 13px; margin-bottom: 0; }

/* ============ Статус-баннер ============ */
.status-banner {
  display: none;
  padding: 10px 14px;
  font-size: 13px;
  border: 2px solid rgba(255, 215, 107, .3);
  background: rgba(46, 35, 10, .72);
  color: #ffe8a5;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.status-banner.show { display: block; }
.status-banner.error { border-color: rgba(255, 138, 107, .6); background: rgba(64, 19, 18, .92); color: #ffd1c7; }

/* ============ Список достижений ============ */
.list-panel { padding: 0; }
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  padding: 18px;
  border-bottom: 2px solid var(--edge-dark);
  box-shadow: 0 2px 0 var(--edge-light);
}
.list-head h2 {
  margin: 6px 0 0;
  font-family: var(--font-pixel);
  font-size: clamp(13px, 1.9vw, 18px);
  line-height: 1.5;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .85), 0 0 18px rgba(255, 215, 107, .25);
}
.count-pill {
  color: var(--gold);
  border: 2px solid rgba(255, 215, 107, .35);
  border-radius: 6px;
  padding: 6px 9px;
  background: rgba(0, 0, 0, .28);
  font-size: 13px;
  white-space: nowrap;
}
.achievement-list {
  display: grid;
  gap: 18px;
  padding: 14px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  scrollbar-color: var(--edge) rgba(0, 0, 0, .2);
}

/* заголовок этапа — как табличка зоны */
.stage-group { display: grid; gap: 8px; }
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: linear-gradient(90deg, rgba(255, 215, 107, .14), transparent 72%);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
}
.stage-name { font-family: var(--font-pixel); font-size: 10px; letter-spacing: .06em; color: var(--gold); text-transform: uppercase; }
.stage-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-items { display: grid; gap: 7px; }

/* карточка достижения — как игровой тост */
.achievement-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(0, 0, 0, .2)), var(--panel-2);
  border: 2px solid var(--edge-dark);
  box-shadow: inset 0 0 0 1px var(--edge-light);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.achievement-card:hover, .achievement-card.active, .achievement-card:focus-visible {
  transform: translateX(4px);
  border-color: rgba(255, 215, 107, .75);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 107, .35), 0 0 16px rgba(255, 215, 107, .14);
}
.achievement-card.done {
  border-color: rgba(126, 224, 111, .5);
  box-shadow: inset 3px 0 0 var(--green), inset 0 0 0 1px rgba(126, 224, 111, .22);
}
.achievement-card.done .card-title { color: var(--green); }

/* слот инвентаря под иконку */
.slot {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 48px;
  padding: 3px;
  background: rgba(4, 6, 16, .8);
  border: 2px solid var(--edge);
  border-radius: 6px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14), inset 0 -2px 0 rgba(0, 0, 0, .4);
  flex: 0 0 auto;
}
.slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.slot .card-check {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #06210a;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--edge-dark), 0 0 10px var(--green);
}
.slot--big { width: 84px; height: 84px; border-width: 3px; }

.card-body { min-width: 0; align-self: center; }
.card-title { margin: 0; font-weight: 800; font-size: 14px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-progress { color: var(--gold); font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; align-self: center; }

/* ============ Бейджи ============ */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 4px;
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge.done { color: #09130d; background: var(--green); border-color: transparent; }
.badge.locked { color: #1a1304; background: var(--gold); border-color: transparent; }
.badge.steam { color: #06131f; background: var(--steam); border-color: transparent; }

/* ============ Детали ============ */
.detail-panel { min-height: 520px; }
.empty-detail { text-align: center; color: var(--muted); padding: 80px 18px; }
.empty-detail h2 {
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 15px;
  line-height: 1.6;
  margin: 12px 0 8px;
}
.moon { font-size: 48px; color: var(--gold); text-shadow: 0 0 24px rgba(255, 215, 107, .4); }
.detail-head { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: center; margin-bottom: 16px; }
.detail-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-pixel);
  font-size: clamp(13px, 1.8vw, 17px);
  line-height: 1.55;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .85), 0 0 18px rgba(255, 215, 107, .25);
}
.detail-desc { color: var(--text); margin: 0; line-height: 1.5; }
.detail-panel .badge-row { margin-bottom: 4px; }

.infobox { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.info-cell {
  background: rgba(0, 0, 0, .3);
  border: 2px solid var(--edge-dark);
  box-shadow: inset 0 0 0 1px var(--edge-light);
  border-radius: 6px;
  padding: 9px 10px;
}
.info-cell span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 900; letter-spacing: .06em; }
.info-cell strong { color: var(--gold); }

.detail-section { margin-top: 18px; }
.detail-section h3 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.detail-section p, .detail-section li { color: var(--text); opacity: .92; line-height: 1.6; }

.single-condition {
  padding: 12px;
  background: rgba(0, 0, 0, .26);
  border: 2px solid var(--edge-dark);
  box-shadow: inset 0 0 0 1px var(--edge-light);
  border-radius: 8px;
  line-height: 1.55;
}
.single-condition.completed { border-color: rgba(126, 224, 111, .45); background: rgba(126, 224, 111, .1); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  background: rgba(0, 0, 0, .26);
  border: 2px solid var(--edge-dark);
  box-shadow: inset 0 0 0 1px var(--edge-light);
  border-radius: 8px;
}
.step input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  cursor: pointer;
  border-radius: 4px;
  background: rgba(4, 6, 16, .85);
  border: 2px solid var(--edge);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step input:checked { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(126, 224, 111, .5); }
.step input:checked::after { content: "✓"; color: #06210a; font-size: 14px; font-weight: 900; line-height: 1; }
.step input:disabled { cursor: default; opacity: .8; }
.step.completed { opacity: .75; border-color: rgba(126, 224, 111, .4); }
.step.completed .step-text { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(126, 224, 111, .7); }
.step.locked { background: rgba(126, 224, 111, .1); }

/* ============ Скелетоны ============ */
.skeleton { height: 68px; opacity: .7; cursor: default; }
.skeleton div, .skeleton span, .skeleton p {
  background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .16), rgba(255, 255, 255, .06));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  min-height: 16px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
