/* подсказка */
#tip { position: fixed; z-index: 50; max-width: 310px; padding: 11px 13px; pointer-events: none; font-size: 13.5px; line-height: 1.5; }
#tip h5 { margin: 0 0 4px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 19px; color: var(--gold); }
#tip .q { color: var(--muted); font-style: italic; }
#tip .g { color: var(--good); }
#tip .y { color: var(--gold); }

/* модальные окна */
#modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8,5,30,.75); }
#modal {
  width: min(470px, 92vw); padding: 22px 24px 24px; text-align: center; border-width: 4px;
  box-shadow: inset 0 0 0 3px var(--gold-lo), inset 0 3px 0 6px rgba(255,255,255,.08), 0 8px 0 #0a0720;
  animation: pop .35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
#modal h3 { margin: 0 0 10px; font-family: 'Rubik', sans-serif; font-weight: 800; font-size: 32px; color: var(--gold); }
#modal p { color: #e4dcff; line-height: 1.5; }
#modal .btns { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
#modal .btns button { padding: 10px 22px; font-size: 15px; }
#modal.wide { width: min(880px, 94vw); }

/* настройки */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 2px dashed rgba(179,169,230,.2); text-align: left; font-size: 14.5px; }
.set-row .muted { color: var(--muted); font-size: 12px; text-align: right; }
.set-sub { text-align: left; margin: 14px 2px 6px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 19px; color: var(--gold); }
#modal .toggle { width: 54px; height: 30px; padding: 0; border-radius: 15px; border: 3px solid var(--out); background: #120e33; position: relative; flex-shrink: 0; box-shadow: none; }
#modal .toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); border: 2px solid var(--out); transition: .2s; }
#modal .toggle.on { background: #3cc860; }
#modal .toggle.on::after { left: 26px; background: #fff; }
#save-text { width: 100%; height: 70px; resize: none; border-radius: 12px; padding: 8px; font-size: 11px; font-family: monospace; background: #120e33; color: var(--text); border: 3px solid var(--out); user-select: text; }
#save-text.err { border-color: var(--bad); animation: shake .3s; }
.set-btns { display: flex; gap: 8px; margin-top: 10px; }
#modal .set-btns button { flex: 1; padding: 9px 6px; font-size: 13px; }

/* карта секторов */
#galmap { width: 100%; height: auto; border-radius: 14px; border: 3px solid var(--out); display: block; margin: 6px 0 14px; }
.sec-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
#modal .sec-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 10px; color: var(--text); text-align: center; transition: transform .12s; }
#modal .sec-card:hover { transform: translateY(-3px); }
#modal .sec-card.sel { background: linear-gradient(180deg, #8a5cf0, #6a3ad0 30%, #4e28a8); box-shadow: inset 0 0 0 3px var(--gold), 0 4px 0 #0a0720; }
.sec-card img { width: 112px; height: 112px; margin: -8px 0 -6px; }
.sec-name { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 18px; color: var(--gold); }
.sec-sub { font-size: 12px; color: var(--muted); }
.sec-mod { font-size: 12.5px; color: #fff; margin-top: 4px; line-height: 1.35; }
.sec-mod b { color: var(--gold-hi); }

/* ежедневные награды */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day img { width: 46px; height: 46px; padding: 3px; }
.day-n { font-size: 11.5px; font-weight: 900; color: var(--muted); }
.day-t { font-size: 10.5px; line-height: 1.2; text-align: center; }
.day.done { opacity: .5; }
.day.done .day-n::after { content: ' ✓'; color: var(--good); }
.day.today { background: linear-gradient(180deg, #4fd06b, #2f9e4c 30%, #237a3e); animation: bobY 1.2s ease-in-out infinite; }
.day.today .day-n { color: #fff; }

@media (max-width: 860px) {
  main { flex-direction: column; }
  #space { flex: none; height: 46vh; }
  #panel { width: 100%; flex: 1; min-height: 0; border-left: 0; border-top: 4px solid var(--out); }
  #top { gap: 14px; padding: 8px 12px; flex-wrap: wrap; }
  .logo { min-width: 0; }
  .logo-t { font-size: 22px; }
  .res-main { font-size: 21px; }
  .res.dm { display: none; }
  #tracker { width: 220px; }
  .sec-cards { grid-template-columns: 1fr; }
  .days { grid-template-columns: repeat(4, 1fr); }
  #comms { bottom: 66px; }
}

/* свойства секторов: плюсы и минусы */
.traits { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; width: 100%; text-align: left; }
.trait {
  display: block; padding: 5px 8px 5px 30px; border-radius: 10px; position: relative; font-size: 12.5px; line-height: 1.25;
  background: rgba(0,0,0,.22); border: 2px solid var(--out);
}
.trait i { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 14px; border: 2px solid var(--out); }
.trait small { color: var(--muted); font-size: 11.5px; }
.trait.good i { background: #3cc860; color: #fff; }
.trait.good b { color: var(--good); }
.trait.bad i { background: #ff5a6e; color: #fff; }
.trait.bad b { color: #ffadb8; }
#sector-mod { display: flex; gap: 10px; }
#sector-mod .pos { color: var(--good); }
#sector-mod .neg { color: #ffb3bd; }

/* карта вселенной */
.map-scroll { overflow-x: auto; border-radius: 14px; border: 3px solid var(--out); margin: 8px 0 12px; }
.map-scroll canvas { display: block; cursor: pointer; }
.map-scroll::-webkit-scrollbar { height: 10px; }
.map-scroll::-webkit-scrollbar-thumb { background: #3a3396; border: 2px solid var(--out); border-radius: 6px; }
.map-info { text-align: left; }
.map-info-head { font-size: 16px; font-weight: 900; color: var(--gold); }
.map-info-head b { color: #fff; }
.map-info-row { font-size: 13px; color: var(--muted); margin: 3px 0 6px; }
.map-info .traits { flex-direction: row; flex-wrap: wrap; }
.map-info .trait { flex: 1 1 220px; }

/* ангар: превью слева, вкладки и плитки вариантов справа */
#modal.hangar { width: min(1000px, 96vw); }
.hg-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; text-align: left; margin-top: 6px; }
#hg-prev { display: block; width: 100%; aspect-ratio: 380 / 260; border-radius: 18px; border: 3px solid var(--out); box-shadow: 0 4px 0 #0a0720; }
#hg-info {
  margin-top: 10px; padding: 9px 12px; border-radius: 14px; border: 3px solid var(--out); background: rgba(0,0,0,.25);
  font-weight: 800; font-size: 14px; min-height: 44px; display: flex; align-items: center;
}
#hg-info b { color: var(--gold); margin-right: 4px; }
.hg-note { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; }
.hg-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.hg-tab {
  flex: 1; padding: 8px 6px; border-radius: 14px; border: 3px solid var(--out); font-weight: 900; font-size: 14px; color: #fff;
  background: linear-gradient(180deg, #3a3396, #282370); box-shadow: inset 0 2px 0 rgba(255,255,255,.15), 0 3px 0 var(--out);
}
.hg-tab.on { color: var(--out); background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); }
.hg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-height: 380px; overflow-y: auto; padding: 2px 4px 6px 2px; }
.hg-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; border-radius: 16px;
  border: 3px solid var(--out); background: linear-gradient(180deg, #2c2680, #1e1a5c); color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 3px 0 #0a0720; transition: transform .1s;
}
.hg-tile img { width: 100%; aspect-ratio: 150 / 96; border-radius: 10px; background: radial-gradient(circle, #3a3396, #16124a); }
.hg-tile:hover { transform: translateY(-2px); filter: brightness(1.1); }
.hg-tile.on { box-shadow: 0 0 0 3px var(--gold), 0 3px 0 #0a0720; background: linear-gradient(180deg, #4a3a96, #2c2470); }
.hg-tile.on span { color: var(--gold); }
.hg-tile.locked img { filter: grayscale(1) brightness(.45); }
.hg-tile.locked span { color: var(--muted); }
.hg-lock { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%); font-style: normal; font-size: 22px; }
@media (max-width: 760px) { .hg-wrap { grid-template-columns: 1fr; } }

/* сезонная лавка */
.ss-head { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 12px; }
.ss-head img { width: 64px; height: 64px; }
.ss-head small { color: var(--muted); font-weight: 700; }
.ss-cur { margin-left: auto; padding: 6px 14px; border-radius: 14px; border: 3px solid var(--out); background: rgba(0,0,0,.25); font-size: 20px; white-space: nowrap; }
.ss-list { display: flex; flex-direction: column; gap: 8px; }
.ss-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; text-align: left;
  border: 2.5px solid var(--out); background: linear-gradient(180deg, #2c2680, #1e1a5c); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 3px 0 #0a0720;
}
.ss-item small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; }
.ss-item button {
  margin-left: auto; min-width: 96px; padding: 6px 12px; border-radius: 12px; border: 3px solid var(--out); font-weight: 900; color: var(--out);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); box-shadow: 0 2px 0 var(--out);
}
.ss-item button:disabled { filter: grayscale(.7) brightness(.75); cursor: default; }
.ss-item.done button { background: linear-gradient(180deg, #8af0a0, #4fd06b); }
.ss-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

/* кнопки рекламы за вознаграждение: всегда подписано, что покажут и что дадут */
.ad-btn {
  display: block; width: 100%; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; border: 3px solid var(--out);
  font-weight: 900; font-size: 14px; color: #fff; text-align: center;
  background: linear-gradient(180deg, #4fd06b, #2e9a48); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 0 var(--out);
}
.ad-btn:hover { filter: brightness(1.1); }
.ad-btn.small { padding: 7px 12px; font-size: 13px; margin: 8px 0 4px; }
.ad-btn.active { background: linear-gradient(180deg, #3a3396, #282370); color: #9fe8ff; cursor: default; }
#modal .btns .ad-btn { display: inline-block; width: auto; margin: 0; }
/* настройки: заметка о прогрессе и раздел «Об игре» */
.set-note { font-size: 13px; color: var(--muted); text-align: left; margin: 0 0 10px; }
.set-about { margin-top: 14px; text-align: left; font-size: 12.5px; color: var(--muted); }
.set-about summary { cursor: pointer; font-weight: 900; color: #fff; margin-bottom: 6px; }
.set-about p { margin: 6px 0; }
.set-links a { color: #9fe8ff; font-weight: 800; }

/* магазин (Tele.Store): карточка — иконка и описание сверху, цена во всю ширину снизу */
.shop-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.shop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; text-align: left; }
.shop-item {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: 1fr auto; gap: 10px 12px; padding: 12px; border-radius: 18px;
  border: 3px solid var(--out); background: linear-gradient(180deg, #2c2680, #1e1a5c); box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 3px 0 #0a0720;
}
.shop-item img { width: 56px; height: 56px; padding: 6px; border-radius: 50%; border: 3px solid var(--out); background: radial-gradient(circle at 40% 35%, #4a42b0, #1a1650); }
.shop-body { min-width: 0; align-self: center; }
.shop-body b { display: block; font-size: 15px; line-height: 1.2; margin-bottom: 3px; }
.shop-body small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.shop-item button {
  grid-column: 1 / -1; padding: 8px 10px; border-radius: 12px; border: 3px solid var(--out); font-weight: 900; font-size: 15px; color: var(--out);
  background: linear-gradient(180deg, #9ff0ff, #5ce1ff 55%, #2ab0e0); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 var(--out);
}
.shop-item button:hover { filter: brightness(1.08); }
.shop-item button:disabled { filter: grayscale(.6) brightness(.8); cursor: default; }
.shop-item.owned { opacity: .85; }
.shop-item.owned button { background: linear-gradient(180deg, #8af0a0, #4fd06b); filter: none; }
