/* Карточка портала — рабочий дизайн (по скрину 2026-09-26) */

/* === Общий контейнер === */
.popup.info {
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.3);
  --gold: #F7CA18;
  --blue: #29B6F6;
  --red: #d32f2f;
  --bg-color: #04151a;
  --bg-dark: #061018;
  --text: #e4f1ee;
  --text-dim: #7a8c8a;
  --team-0: #bbbbbb;
  --team-1: #00c2ff;
  --team-2: #00f270;
  --glow: 0 0 5px var(--cyan);

  position: fixed;
  inset: 0;
  background: var(--bg-color);
  color: var(--text);
  font-family: var(--ingress-font, 'Coda', 'Rajdhani', 'Segoe UI', system-ui);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}
.popup.info.hidden { display: none; }

/* === Header === */
.popup.info .header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bg-dark);
  border-bottom: 2px solid var(--cyan);
  box-shadow: 0 1px 6px rgba(0,229,255,.4);
  flex-shrink: 0;
}
.popup.info .header .title {
  flex: 1;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.popup.info .header .level {
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  padding: 2px 8px;
  border: 1px solid var(--gold);
  background: rgba(247,202,24,.1);
  flex-shrink: 0;
  text-shadow: 0 0 4px rgba(247,202,24,.6);
}
.popup.info .header .i-close {
  background: none;
  border: 0;
  color: var(--cyan);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* === Content === */
.popup.info .content {
  display: flex;
  flex: 1;
  padding: 10px;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

/* === col-left: фото + диаграмма === */
.popup.info .col-left {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
.popup.info .image-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  container-type: inline-size;
  border: 2px solid var(--cyan);
  box-shadow: var(--glow), inset 0 0 8px rgba(0,229,255,.3);
  position: relative;
  background-color: #062b33;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.popup.info .image-box .info-icon {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0,229,255,.6);
  color: rgba(0,229,255,.6);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0,0,0,.5);
}
.popup.info .keys-badge {
  position: absolute;
  bottom: 2cqw;
  right: 2cqw;
  display: inline-flex;
  align-items: center;
  gap: 1.5cqw;
  padding: 2cqw 3cqw;
  background: rgba(0,0,0,.8);
  border: 0.3cqw solid var(--gold);
  color: var(--gold);
  font-size: 7cqw;
  font-weight: 700;
  line-height: 1;
  z-index: 5;
  pointer-events: none;
}
.popup.info .keys-badge.hidden { display: none; }
.popup.info .keys-badge svg { flex-shrink: 0; }

/* Диаграмма: 4+4 резонатора, LINK по центру */
.popup.info .diagram-container {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--cyan-dim);
  background: rgba(0,0,0,.2);
}
.popup.info .reso-col {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
}
.popup.info .reso-col.top { top: 10px; }
.popup.info .reso-col.bottom { bottom: 10px; flex-direction: column-reverse; }
.popup.info .reso-col.col-1 { left: 25%; }
.popup.info .reso-col.col-2 { left: 50%; }
.popup.info .reso-col.col-3 { left: 75%; }
.popup.info .reso-col.col-4 { display: none; }
.popup.info .reso-bar {
  width: 8px;
  height: 60px;
  background-color: #000;
  border: 1px solid rgba(0,229,255,.3);
  position: relative;
}
.popup.info .reso-col.top .reso-bar { height: 60px; }
.popup.info .reso-col.bottom .reso-bar { height: 60px; }
.popup.info .reso-fill {
  position: absolute;
  left: 0;
  width: 100%;
  bottom: 0;
  box-shadow: 0 0 4px currentColor;
}
.popup.info .reso-label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0;
  text-shadow: 0 0 3px var(--gold);
}
.popup.info .link-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0,229,255,.5);
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 10;
  cursor: pointer;
  transition: all .15s;
}
.popup.info .link-center:hover {
  background: rgba(0,229,255,.25);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,229,255,.5);
}
.popup.info .link-center.disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* ═══ LINK-карусель ═══ */
.link-carousel__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  padding: 0;
}
.link-carousel {
  width: 100%;
  max-width: 620px;
  max-height: 80vh;
  background: #0a1418;
  border-top: 2px solid #00B6BF;
  border-left: 1px solid #00B6BF44;
  border-right: 1px solid #00B6BF44;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Rajdhani', 'Coda', sans-serif;
  color: #e4f1ee;
  box-shadow: 0 -8px 24px rgba(0,0,0,.6);
}
.link-carousel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #00B6BF33;
  background: #061018;
}
.link-carousel__title {
  font-family: 'Coda', 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #FCF28C;
}
.link-carousel__close {
  background: none;
  border: 0;
  color: #5d6b6b;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.link-carousel__close:active { color: #FCF28C; }
.link-carousel__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.link-carousel__track::-webkit-scrollbar { display: none; }
.link-carousel__card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 140px;
  background: #0e1a22;
  border: 1px solid #00B6BF44;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  color: #e4f1ee;
  font-family: inherit;
  overflow: hidden;
  transition: border-color .15s, transform .1s;
  text-align: left;
}
.link-carousel__card:active { transform: scale(.97); border-color: #00F2FF; }
.link-carousel__card.used { opacity: .35; pointer-events: none; }
.link-carousel__img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #061018;
  overflow: hidden;
}
.link-carousel__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-carousel__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #5d6b6b;
  font-size: 24px;
}
.link-carousel__badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,.8);
  border: 1px solid #FCF28C;
  color: #FCF28C;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  line-height: 1;
}
.link-carousel__info { padding: 6px 8px 8px; }
.link-carousel__name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.link-carousel__dist {
  font-size: 11px;
  color: #00F2FF;
  font-weight: 700;
}
.popup.info .node {
  width: 6px;
  height: 8px;
  background-color: var(--cyan);
  box-shadow: 0 0 3px var(--cyan);
  clip-path: polygon(50% 0%,100% 50%,50% 100%,0% 50%);
  position: absolute;
}
.popup.info .d-line {
  position: absolute;
  background-color: rgba(0,229,255,.4);
}
.popup.info .v-line { width: 1px; height: 20px; }
.popup.info .v-t-1 { top: 72px; left: calc(25% + 8px); }
.popup.info .v-t-2 { top: 72px; left: calc(50% + 8px); }
.popup.info .v-t-3 { top: 72px; left: calc(75% + 8px); }
.popup.info .v-t-4 { display: none; }
.popup.info .v-b-1 { bottom: 72px; left: calc(25% + 8px); }
.popup.info .v-b-2 { bottom: 72px; left: calc(50% + 8px); }
.popup.info .v-b-3 { bottom: 72px; left: calc(75% + 8px); }
.popup.info .v-b-4 { display: none; }

/* === col-right === */
.popup.info .col-right {
  flex: .9;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.popup.info .stats-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--cyan-dim);
}
.popup.info .stat-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.popup.info .stat-label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.popup.info .stat-value {
  color: var(--cyan);
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popup.info .stat-value.blue { color: var(--blue); }
.popup.info .stat-row.hidden { display: none; }
.popup.info .key-icon { display: none; }
.popup.info .share-icon {
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
}
.popup.info .share-dot {
  width: 4px;
  height: 4px;
  background: var(--cyan);
  border-radius: 50%;
  position: absolute;
  box-shadow: var(--glow);
}
.popup.info .share-dot:nth-child(1) { top: 5px; left: 0; }
.popup.info .share-dot:nth-child(2) { top: 0; right: 0; }
.popup.info .share-dot:nth-child(3) { bottom: 0; right: 0; }
.popup.info .share-line {
  width: 8px;
  height: 1px;
  background: var(--cyan);
  position: absolute;
  transform-origin: left;
}
.popup.info .share-line:nth-child(4) { top: 6px; left: 2px; transform: rotate(-30deg); }
.popup.info .share-line:nth-child(5) { top: 6px; left: 2px; transform: rotate(30deg); }

/* === Action buttons === */
.popup.info .action-btn {
  padding: 12px 10px;
  background: rgba(4,21,26,.9);
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  line-height: 1.1;
  box-shadow: 0 0 4px rgba(0,229,255,.3), inset 0 0 6px rgba(0,229,255,.15);
  text-shadow: 0 0 3px rgba(0,229,255,.4);
  transition: background .15s;
}
.popup.info .action-btn:active { background: rgba(0,229,255,.2); }
.popup.info .action-btn .btn-text-main { font-size: 13px; }
.popup.info .action-btn .btn-text-sub {
  font-size: 10px;
  opacity: .7;
  letter-spacing: .08em;
  font-weight: 500;
  text-transform: lowercase;
}
.popup.info .action-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}
.popup.info .action-btn.mod-btn {
  border-color: rgba(0,229,255,.4);
  color: rgba(0,229,255,.6);
}
.popup.info .action-btn.ok-btn {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 4px rgba(247,202,24,.3);
  text-shadow: 0 0 3px rgba(247,202,24,.4);
}

/* === Footer === */
.popup.info .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--bg-dark);
  border-top: 1px solid var(--cyan-dim);
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.popup.info .footer-text {
  display: flex;
  gap: 8px;
  align-items: center;
}
.popup.info #i-footer-time { color: var(--cyan); }
.popup.info .comm-section {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.popup.info .comm-slant { display: none; }

@media (max-width: 480px) {
  .popup.info .header .title { font-size: 16px; }
}
