/* Profile — 1-в-1 Ingress Prime (PlayerProfileStyles.java). Чистый CSS. */

/* ===== Экран ===== */
.screen.profile {
  position: fixed; inset: 0; z-index: 100;
  background: #000; color: #CCC;
  display: flex; flex-direction: column;
  font-family: 'Manrope', 'Coda', system-ui, sans-serif;
  overflow: hidden;
}
.screen.profile.hidden { display: none; }

/* ===== Верхние табы ===== */
.pr-tabs {
  display: flex; padding: 6px 8px 0;
  border-bottom: 1px solid #2deff9aa;
  background: #000; flex-shrink: 0;
}
.pr-tab {
  flex: 1; background: none; border: 0;
  color: #00bab5;
  font-family: 'Coda', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 4px 6px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.pr-tab.active { color: #2deff9; border-bottom-color: #2deff9; text-shadow: 0 0 6px #2deff988; }

/* ===== Скролл-область ===== */
.pr-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px; -webkit-overflow-scrolling: touch;
}

/* ===== Header: аватар 74px | ник + AP-бар | уровень ===== */
.pr-header { display: flex; align-items: flex-start; gap: 10px; }
.pr-avatar {
  width: 74px; height: 74px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.pr-avatar img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.pr-header-info { flex: 1; display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }
.pr-nick {
  font-family: 'Coda', sans-serif;
  font-size: 20px; font-weight: 700; line-height: 1.05;
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #CCC;
}
.pr-nick.team-1 { color: #B00; }
.pr-nick.team-2 { color: #0B0; }

/* AP-бар — всегда голубой (в Ingress не по команде) */
.pr-ap-progress {
  position: relative; height: 8px; margin-top: 6px;
  background: #111; border: 1px solid #333;
}
.pr-ap-check { position: absolute; top: 0; width: 1px; height: 100%; background: #666; }
.pr-ap-check:nth-child(even) { width: 2px; transform: translate(-50%, 0); }
.pr-ap-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(180deg, #2deff9, #007aa3);
  transition: width .3s ease;
}
.pr-ap-row {
  display: flex; justify-content: space-between; margin-top: 4px;
  font-family: 'Coda', sans-serif; font-size: 12px;
}
.pr-ap-now { color: #CCC; }
.pr-ap-next { color: #666; }

/* Уровень — цифра серая (в Ingress не по команде) */
.pr-level {
  display: flex; flex-direction: column; align-items: center;
  padding-left: 4px; flex-shrink: 0;
}
.pr-level-label { font-size: 9px; color: #666; letter-spacing: .15em; text-transform: uppercase; }
.pr-level-num {
  font-family: 'Coda', sans-serif;
  font-size: 38px; font-weight: 700; line-height: 1;
  color: #CCC; margin-top: -2px;
}

/* ===== Строка «Медали: N» + счётчики тиров ===== */
.pr-medal-reqs {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding: 6px 10px;
  background: linear-gradient(90deg, rgba(0,102,91,.35), transparent 70%);
  border-left: 2px solid rgba(0,186,181,.5);
  font-family: 'Coda', sans-serif; font-size: 12px;
}
.pr-medal-reqs__label { color: #75f7ff; margin-right: 4px; }
.pr-req-item { display: flex; align-items: center; gap: 2px; }
.pr-req-icon { width: 12px; height: 14px; object-fit: contain; image-rendering: pixelated; }
.pr-req-have { color: #75f7ff; font-size: 13px; font-weight: 700; }
.pr-req-total { color: #00bab5; font-size: 11px; }

/* ===== Сетка медалей — 6/ряд, gap-h 0, gap-v -6 (перекрытие), tile-diag ===== */
/* Медали — honeycomb 1-в-1 со скрином Ingress.
   Ряд = 6 медалей, чётные ряды сдвинуты на полмедали (8.33%).
   Перекрытие рядов через margin-bottom. */
.pr-medals-grid {
  margin-top: 16px;
  padding: 8px 14px;
  background-image: url('/sprites/common/tile-diag.png');
  background-repeat: repeat;
  background-color: #061018;
}
.pr-medal-row {
  display: flex;
  justify-content: flex-start;
  gap: 5px;
  margin-bottom: -6px; /* Ingress: SPACING_BETWEEN_MEDALS_VERTICAL_DP = -6.0f */
}
.pr-medal-row:last-child {
  margin-bottom: 0;
}
.pr-medal-row:nth-child(even) {
  margin-left: calc(8.33% + 2.5px);
}
.pr-medal {
  flex: 0 0 calc(16.66% - 5px);
  aspect-ratio: 1 / 1.155;
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
  min-width: 0; min-height: 0;
}
.pr-medal:active { transform: scale(0.94); }
.pr-medal:active { transform: scale(0.94); }
.pr-medal__hex {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: fill;
  image-rendering: pixelated; pointer-events: none;
}
.pr-medal__hex + .pr-medal__svg { inset: 10% 8%; width: 84%; height: 80%; }
.pr-medal__svg {
  position: absolute; inset: 4%;
  width: 92%; height: 92%;
  pointer-events: none;
}
.pr-medal__locked {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  image-rendering: pixelated; pointer-events: none;
}
.pr-medal.tier-locked .pr-medal__svg { display: none; }
.pr-medal__progress {
  position: absolute; bottom: 10%; left: 30%; right: 30%; height: 2px;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.15);
  z-index: 2;
}
.pr-medal__progress-fill { height: 100%; background: #ffd652; box-shadow: 0 0 3px #ffd652cc; }

/* Палитра тиров Ingress — цвета SVG-медалей через CSS-переменные */
.pr-medal.tier-bronze   { --medal-bg: #6b3a14; --medal-icon: #d9a26a; --medal-accent: #e0b070; }
.pr-medal.tier-silver   { --medal-bg: #46505a; --medal-icon: #e0e8f0; --medal-accent: #c8d8e4; }
.pr-medal.tier-gold     { --medal-bg: #7a5410; --medal-icon: #f5e08c; --medal-accent: #ffe080; }
.pr-medal.tier-platinum { --medal-bg: #1a2c3e; --medal-icon: #ffffff; --medal-accent: #b8d0e8; }
.pr-medal.tier-onyx     { --medal-bg: #0a0a0a; --medal-icon: #2c2c2c; --medal-accent: #4a4a4a; }
.pr-medal.tier-locked   { --medal-bg: #1a1a1a; --medal-icon: #333; --medal-accent: #222; }
.pr-modal__medal svg use { display: block; }

/* Модалка медали — 1-в-1 Ingress */
.pr-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.pr-modal.hidden { display: none; }
.pr-modal__bg { position: absolute; inset: 0; background: rgba(0,0,0,.85); }
.pr-modal__card {
  position: relative; width: 96%; max-width: 480px;
  background: #0a0e14; border: 2px solid #5a6472; padding: 16px;
  box-sizing: border-box; box-shadow: 0 0 40px rgba(0,0,0,.9);
}
.pr-modal__close {
  position: absolute; top: 6px; right: 10px;
  background: none; border: 0; color: #8a94a0; font-size: 24px; cursor: pointer;
  font-family: 'Coda', sans-serif; line-height: 1;
}
.pr-modal__close:hover { color: #fff; }
.pr-modal__top { display: flex; gap: 16px; align-items: flex-start; padding: 8px 32px 8px 0; }
.pr-modal__medal { width: 96px; height: 112px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.pr-modal__medal svg { width: 100%; height: 100%; }
.pr-modal__info { flex: 1; min-width: 0; }
.pr-modal__title {
  margin: 0 0 6px; font-family: 'Coda', sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #2deff9;
}
.pr-modal__desc { margin: 0 0 8px; font-size: 12px; color: #8a94a0; line-height: 1.4; }
.pr-modal__counter {
  font-family: 'Coda', sans-serif; font-size: 22px; font-weight: 700; color: #ffd651;
  letter-spacing: .05em;
}
.pr-modal__tiers {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin-top: 12px; padding-top: 12px; border-top: 2px solid #333;
}
.pr-tier {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border: 1px solid #333;
}
.pr-tier.unlocked { border-color: currentColor; }
.pr-tier.locked { opacity: .35; }
.pr-tier__icon { width: 28px; height: 32px; }
.pr-tier__icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.pr-tier__val { font-family: 'Coda', sans-serif; font-size: 11px; text-align: center; letter-spacing: .04em; }
.pr-tier.tier-bronze { color: #d9a26a; }
.pr-tier.tier-silver { color: #d0dae2; }
.pr-tier.tier-gold { color: #ffe080; }
.pr-tier.tier-platinum { color: #ffffff; }
.pr-tier.tier-onyx { color: #6a6a6a; }

.pr-separator { height: 2px; background: linear-gradient(90deg, transparent, #00f2ff88, transparent); margin: 12px 0; }

/* ===== Сетка badges/awards ===== */
.pr-badges-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.pr-badge {
  position: relative; aspect-ratio: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pr-badge__shape { position: absolute; inset: 0; width: 100%; height: 100%; }
.pr-badge__icon { position: relative; z-index: 1; font-size: 1.4rem; }

/* ===== Tabs stats ===== */
.pr-stats-tabs { display: flex; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.pr-stats-tab {
  flex: 1; text-align: center; padding: 6px 0;
  font-family: 'Coda', sans-serif; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  color: #666; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.pr-stats-tab:hover { border-bottom-color: #333; }
.pr-stats-tab.active { color: #2deff9; border-bottom-color: #2deff9; }

/* ===== Метрики ===== */
.pr-stats { margin-top: 8px; }
.pr-stats__section { margin-bottom: 12px; }
.pr-stats__section-header {
  margin: 0 0 4px 6px;
  font-family: 'Coda', sans-serif; font-size: 11px;
  letter-spacing: .15em; text-transform: uppercase; color: #ffd651;
}
.pr-stat {
  display: grid; grid-template-columns: 6fr 4fr; gap: 8px;
  padding: 4px 6px; font-size: 12px;
}
.pr-stat span:last-child { text-align: right; color: #ffd651; font-weight: 700; }
.pr-stat:not(:last-child) { border-bottom: 1px solid #1a2428; }
.pr-stat-title { color: #00bab5; }
