:root {
  --orange: #FF4600;
  --orange-bright: #ff6a00;
  --pink: #ff1493;
  --purple: #a855f7;
  --purple-glow: #b829ea;
  --cyan: #00e5ff;
  --gold: #ffd700;
  --red: #ff2a2a;
  --card-bg: rgba(14, 11, 20, 0.96);
  --card-border: rgba(255, 255, 255, 0.12);
  --radius-lg: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ===================================================
   БАЗОВЫЙ ФОН (АППАРАТНОЕ УСКОРЕНИЕ)
   =================================================== */
body {
  background-color: #07050b;
  color: #fff;
  font-family: 'Unbounded', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 4px 12px 140px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #07050b;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 70, 0, 0.28) 0%, transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(255, 20, 147, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(0, 229, 255, 0.1) 0%, transparent 40%),
    url('bg.png');
  background-repeat: repeat;
  background-size: 340px;
  pointer-events: none;
  transform: translateZ(0);
}

.app-viewport {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===================================================
   ИНТРО ПРЕЛОАДЕР
   =================================================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  cursor: pointer;
  transform: translateZ(0);
}

.intro-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-video {
  width: min(68vw, 260px);
  height: min(68vw, 260px);
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* ===================================================
   ШАПКА
   =================================================== */
.header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0 0;
  overflow: hidden;
}

.logo-crop-wrapper {
  width: 100%;
  max-width: 410px;
  height: 110px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  transform: translateY(1%);
  filter: drop-shadow(0 0 16px rgba(255, 70, 0, 0.75));
  pointer-events: none;
}

/* ===================================================
   КАРТОЧКА НОМИНАЦИИ (ИЗОЛИРОВАННЫЙ СЛОЙ)
   =================================================== */
.nomination-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  contain: content; /* Изолирует перерисовки внутри группы */
}

.nomination-group:not(.open) .nominees-list {
  content-visibility: auto;
  contain-intrinsic-size: 0 450px;
}

.category-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.category-card:active {
  transform: scale(0.985);
}

/* ===================================================
   РЕЖИМ БАННЕРА
   =================================================== */
.category-card.banner-mode {
  padding: 0;
  min-height: 125px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #000;
}

.category-card.banner-mode.theme-gold {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 215, 0, 0.15);
}
.nomination-group.open .category-card.banner-mode.theme-gold {
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 22px rgba(255, 215, 0, 0.4);
}

.category-card.banner-mode.theme-purple {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(168, 85, 247, 0.18);
}
.nomination-group.open .category-card.banner-mode.theme-purple {
  border-color: var(--purple);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 24px rgba(184, 41, 234, 0.4);
}

.banner-img-wrap {
  width: 100%;
  height: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  overflow: hidden;
}

.banner-poster-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.25s ease;
}

@media (hover: hover) {
  .category-card.banner-mode:hover .banner-poster-img {
    transform: scale(1.03);
  }
}

.banner-overlay-bar {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, transparent 60%, rgba(5, 3, 9, 0.88) 100%);
  z-index: 3;
}

.banner-chevron-wrap {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(10, 7, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.banner-tag {
  background: rgba(14, 11, 22, 0.95);
  border: 1px solid var(--orange);
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(255, 70, 0, 0.5);
}

/* ===================================================
   СТАНДАРТНАЯ КАРТОЧКА
   =================================================== */
.category-card.standard-mode {
  padding: 10px 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-card.standard-mode::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: transparent;
  transition: background 0.2s ease;
}

.nomination-group.open .category-card.standard-mode::before {
  background: linear-gradient(180deg, var(--orange), var(--pink));
}

.category-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.category-header-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.category-title-img {
  height: 36px;
  width: 190px;
  object-fit: cover;
  object-position: center;
  display: block;
  mix-blend-mode: screen;
}

.category-title-fallback {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
}

.category-selected-tag {
  font-size: 10px;
  color: var(--orange-bright);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  text-shadow: 0 0 8px rgba(255, 70, 0, 0.6);
}

.chevron-icon {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 3.5;
  fill: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  opacity: 0.85;
}

.nomination-group.open .chevron-icon {
  transform: rotate(90deg);
  stroke: var(--orange);
}

.nominees-list {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nominees-list-inner {
  overflow: hidden;
  padding: 4px 2px 8px;
}

.nomination-group.open .nominees-list {
  grid-template-rows: 1fr;
}

.nominees-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* ===================================================
   КАРТОЧКА КАНДИДАТА
   =================================================== */
.char-card {
  background: rgba(18, 14, 25, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  transform: translateZ(0); /* Включает отдельный GPU слой */
}

.char-card:active {
  transform: scale(0.96);
}

.char-photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (hover: hover) {
  .char-card:hover .char-photo {
    transform: scale(1.04);
    transition: transform 0.25s ease;
  }
}

.char-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(13, 10, 20, 0.95) 100%);
  pointer-events: none;
}

.char-stamp {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
  transform: scale(0) rotate(-8deg);
  opacity: 0;
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
}

.char-footer {
  padding: 9px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(13, 10, 20, 0.95);
  z-index: 1;
}

.char-name {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #eee;
}

.char-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.char-card.selected {
  border-color: var(--orange);
  box-shadow: 0 0 16px rgba(255, 70, 0, 0.45);
  transform: scale(1.02);
}

.char-card.selected .char-stamp {
  opacity: 1;
  transform: scale(1) rotate(-4deg);
}

.char-card.selected .char-name {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 70, 0, 0.8);
}

.char-card.selected .char-dot {
  background: var(--orange);
  border-color: #fff;
  box-shadow: 0 0 8px var(--orange);
}

#group-bday .char-photo {
  object-fit: contain;
  padding: 8px;
}

/* ===================================================
   ЗАБЛОКИРОВАННЫЙ КАНДИДАТ
   =================================================== */
.char-card.locked-card {
  filter: grayscale(0.9) contrast(0.85);
  opacity: 0.55;
  border-color: rgba(255, 42, 42, 0.35);
}

.char-card.locked-card .char-stamp {
  opacity: 1;
  transform: scale(1) rotate(-6deg);
  background: linear-gradient(135deg, var(--red) 0%, #8b0000 100%);
  font-size: 8px;
}

.char-card.locked-card .char-name {
  color: #888;
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

.char-card.locked-card .char-dot {
  border-color: var(--red);
  background: rgba(255, 42, 42, 0.2);
}

.modal-vote-btn.locked {
  background: #251218 !important;
  border: 1.5px solid var(--red) !important;
  color: #ff6b6b !important;
  cursor: not-allowed;
}

.modal-badge.badge-locked {
  border-color: var(--red) !important;
  color: #ff8888 !important;
}

.shake-anim {
  animation: gta-shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gta-shake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* ===================================================
   МОДАЛЬНЫЕ ОКНА
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 8, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  transform: translateZ(0);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: rgba(16, 12, 24, 0.98);
  border: 1.5px solid rgba(255, 70, 0, 0.6);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.95), 0 0 25px rgba(255, 70, 0, 0.35);
  position: relative;
  display: flex;
  flex-direction: column;
  transform: translateY(15px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  background: rgba(10, 7, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.modal-img-wrap {
  width: 100%;
  height: 200px;
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.modal-img-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(16, 12, 24, 0.98) 100%);
  pointer-events: none;
}

.modal-badge {
  display: inline-block;
  align-self: flex-start;
  background: rgba(14, 11, 22, 0.92);
  border: 2px solid var(--orange);
  color: #fff;
  font-family: 'Unbounded', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: 0 0 14px rgba(255, 70, 0, 0.55);
  text-transform: uppercase;
}

.modal-body {
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-title {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: -0.3px;
  text-shadow: 0 0 12px rgba(255, 70, 0, 0.6);
}

.modal-vote-btn {
  margin-top: 4px;
  width: 100%;
  background: linear-gradient(135deg, var(--orange) 0%, #e03200 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 70, 0, 0.5);
  transition: transform 0.15s ease;
}

.modal-vote-btn:active {
  transform: scale(0.98);
}

.modal-vote-btn.voted {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5);
}

/* ===================================================
   ОКНО РЕЗУЛЬТАТОВ (MISSION PASSED)
   =================================================== */
.result-modal-card {
  max-width: 400px;
  border: 1.5px solid rgba(255, 215, 0, 0.55);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 215, 0, 0.3);
}

.result-header {
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: 
    radial-gradient(circle at 50% 0%, rgba(255, 70, 0, 0.35) 0%, transparent 75%),
    linear-gradient(180deg, rgba(28, 20, 42, 0.9) 0%, rgba(16, 12, 24, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  position: relative;
}

.result-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.result-badge.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid #10b981;
  color: #34d399;
}

.result-badge.warning {
  background: rgba(255, 70, 0, 0.2);
  border: 1.5px solid var(--orange);
  color: var(--orange-bright);
}

.result-title {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 20%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-stars {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.result-stars .star-icon {
  width: 22px;
  height: 22px;
  fill: #221d30;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.2s ease;
}

.result-stars .star-icon.active {
  fill: var(--gold);
  transform: scale(1.15);
}

.result-body {
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #b3b7cb;
  line-height: 1.45;
  text-align: center;
}

.result-summary-box {
  background: rgba(10, 8, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  max-height: 175px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 6px;
  scrollbar-width: thin;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 10px;
}
.summary-row:last-child {
  border-bottom: none;
}

.summary-nom {
  color: #8c90a6;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.summary-val {
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.summary-row.missing .summary-val {
  color: var(--red);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  font-family: 'Unbounded', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-btn.primary {
  background: linear-gradient(135deg, var(--orange) 0%, #ff1493 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 70, 0, 0.45);
}

.result-btn.primary:active {
  transform: scale(0.98);
}

.result-btn.secondary {
  background: rgba(22, 17, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #bbb;
}

/* ===================================================
   ПЛАВАЮЩИЙ БАР (МАКСИМАЛЬНАЯ ПРОИЗВОДИТЕЛЬНОСТЬ)
   =================================================== */
.bottom-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  width: calc(100% - 24px);
  max-width: 440px;
  background: rgba(14, 11, 22, 0.97); /* Без размытия фона — нулевая нагрузка при скролле */
  border: 1.5px solid rgba(255, 70, 0, 0.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 16px rgba(255, 70, 0, 0.25);
  border-radius: 22px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 1000;
}

.wanted-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wanted-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 900;
  color: #aaa;
  letter-spacing: 0.5px;
}

.wanted-header span {
  color: var(--orange-bright);
}

.stars-row {
  display: flex;
  gap: 3px;
}

.star-icon {
  width: 14px;
  height: 14px;
  fill: #2a2638;
  transition: transform 0.2s ease, fill 0.2s ease;
}

.star-icon.active {
  fill: var(--gold);
  transform: scale(1.1);
}

/* ===================================================
   КНОПКА ОТПРАВИТЬ С GPU-СВЕЧЕНИЕМ
   =================================================== */
.submit-btn {
  position: relative;
  background: linear-gradient(135deg, var(--orange) 0%, #e03200 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 11px 18px;
  font-family: inherit;
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 70, 0, 0.45);
  transition: transform 0.15s ease;
  white-space: nowrap;
  overflow: visible;
}

.submit-btn:active {
  transform: scale(0.96);
}

/* Аппаратно ускоренное свечение без перерисовки слоев */
.submit-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff4600, #ff1493);
  z-index: -1;
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.submit-btn.ready {
  background: linear-gradient(135deg, #ff4600 0%, #ff1493 100%);
}

.submit-btn.ready::after {
  opacity: 0.85;
  animation: gpu-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes gpu-pulse {
  0% { transform: scale(0.96); opacity: 0.5; }
  100% { transform: scale(1.05); opacity: 0.95; }
}