/* ============================================
   СВЯЗЬ — Theme Overrides
   Terracotta / Warm Steel / Chain Link
   ============================================ */

/* Accent: terracotta / warm rust */
:root {
  --accent: #C45C2A;
  --accent-glow: rgba(196, 92, 42, 0.15);
  --accent-dim: rgba(196, 92, 42, 0.4);
  --accent-bright: #E06A30;
}

/* Suppress shared grid — chain-bg replaces it */
.grid-bg { display: none; }

/* --- Chain Link Background Pattern --- */
.chain-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='40' viewBox='0 0 60 40'%3E%3Cellipse cx='15' cy='20' rx='12' ry='7' fill='none' stroke='%23C45C2A' stroke-width='3'/%3E%3Cellipse cx='45' cy='20' rx='12' ry='7' fill='none' stroke='%23C45C2A' stroke-width='3'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px 40px;
}

/* Secondary subtle grid for depth */
.chain-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(196, 92, 42, 0.015) 39px, rgba(196, 92, 42, 0.015) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(196, 92, 42, 0.015) 39px, rgba(196, 92, 42, 0.015) 40px);
}

/* --- SVG Route Map --- */
.route-map {
  position: relative;
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.route-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.route-path {
  fill: none;
  stroke: var(--accent-dim);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.route-path-active {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-dot {
  fill: var(--bg-elevated);
  stroke: var(--accent-dim);
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.3s, stroke 0.3s, r 0.2s;
}

.station-dot:hover,
.station-dot.active {
  fill: var(--accent);
  stroke: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.station-dot-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-dim);
  pointer-events: none;
  transition: fill 0.3s;
}

.map-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
}

/* --- Chain Link visual connector on map --- */
.chain-connector {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}

/* --- Act cards --- */
.act-card {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-top: 3px solid var(--accent-dim);
  padding: var(--space-md);
  transition: border-top-color 0.3s;
}

.act-card:hover { border-top-color: var(--accent); }

.act-card.act-main {
  border-top-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* --- Metrics Block --- */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.04);
  margin: var(--space-xl) 0;
}

.metric-item {
  background: var(--bg-surface);
  padding: var(--space-md);
  text-align: center;
}

/* --- Chain visual banner (replaces code-banner) --- */
.chain-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-md) 0;
  margin: var(--space-lg) 0;
  overflow: hidden;
}

.chain-link {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chain-link svg {
  width: clamp(48px, 8vw, 80px);
  height: clamp(32px, 5vw, 54px);
  transition: opacity 0.3s;
}

.chain-link.locked svg ellipse {
  stroke: rgba(255,255,255,0.06);
}

.chain-link.locked svg text {
  fill: transparent;
}

/* --- Station Grid for СВЯЗЬ --- */
.stations-grid-svyaz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

/* --- Film note / ceremony block --- */
.film-note {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-lg);
}

.film-note-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  align-self: center;
}

/* --- Artifact visual --- */
.artifact-visual {
  aspect-ratio: 16/9;
  background: var(--bg-surface);
  border: var(--border-subtle);
  overflow: hidden;
  position: relative;
}

.artifact-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  filter: brightness(0.6) contrast(1.1) sepia(0.1);
  transition: opacity 0.4s, filter 0.4s;
}

.artifact-visual:hover img {
  opacity: 0.85;
  filter: brightness(0.75) contrast(1.0) sepia(0.05);
}

/* --- Score donut colors for СВЯЗЬ --- */
.score-donut .segment-svyaz { stroke: var(--accent); }

/* --- Contractor block --- */
.contractor-block {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-left: 3px solid var(--accent-dim);
  padding: var(--space-md);
}

.contractor-levels {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contractor-level {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  font-size: 0.9rem;
}

.level-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  min-width: 2rem;
  padding-top: 0.1rem;
}

/* --- Chain ritual highlight --- */
.chain-ritual {
  background: var(--bg-surface);
  border: var(--border-accent);
  padding: var(--space-lg);
  text-align: center;
  position: relative;
}

.chain-ritual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* --- Station active highlight --- */
.station-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* --- Nomination featured override --- */
.nomination-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(196,92,42,0.05) 100%);
}

/* --- Scoring indicator bars --- */
.score-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin-top: var(--space-xs);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* --- Score criteria breakdown --- */
.score-criteria {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.score-criterion {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
}

.score-criterion-label {
  flex: 1;
  color: var(--text-secondary);
}

.score-criterion-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 3rem;
  text-align: right;
}

@media (max-width: 768px) {
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .stations-grid-svyaz { grid-template-columns: 1fr; }
  .film-note { grid-template-columns: 1fr; }
  .chain-banner { gap: var(--space-xs); }
}
