/* Соревнование клана: сезон гонкой, таблица недели со спарклайнами, история,
   лента. Справа — «Я в сезоне». На телефоне рельса складывается под карточку
   сезона (макет 1e), а широкие колонки таблицы прячутся. */

.cc-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  align-items: start;
}
.cc-wrap-solo { grid-template-columns: minmax(0, 1fr); }
.cc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cc-rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }

.cc-panel { position: relative; overflow: hidden; }

/* --- сезон --- */
.cc-season {
  background:
    radial-gradient(700px 260px at 0% 0%, rgba(255, 201, 77, 0.14), transparent 70%),
    var(--surface);
}
.cc-season-edge {
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--accent-grad);
}
.cc-season-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.cc-season-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-season-badge {
  font: 700 11px Oswald, sans-serif; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); padding: 4px 8px;
  border: 1px solid rgba(255, 201, 77, 0.4); border-radius: 3px;
}
.cc-season-status { font-size: 12px; color: var(--text-dim); }
.cc-season-status b { color: var(--text); }
.cc-season-title { font: 600 30px/1.1 Oswald, sans-serif; letter-spacing: 0.02em; margin-top: 10px; }
.cc-season-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px;
  font-size: 12.5px; color: var(--text-dim);
}
.cc-prize { color: var(--accent); }
.cc-owner-btn {
  flex: none; padding: 9px 16px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  color: var(--text); font-weight: 700; font-size: 13px; text-decoration: none;
}
.cc-owner-btn:hover { background: rgba(255, 255, 255, 0.09); }
.cc-progress { height: 6px; border-radius: 3px; margin: 16px 0; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.cc-progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent-grad); }

.cc-season-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: stretch; }

/* --- график гонки --- */
.cc-chart { padding: 14px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line-soft); }
.cc-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cc-chart-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.cc-chart-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--text-dim); }
.cc-chart-legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 4px; }
.cc-chart-svg { margin-top: 8px; display: block; }
.cc-chart-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-faint); margin-top: 4px; }

/* --- подиум сезона --- */
.cc-podium { display: flex; flex-direction: column; gap: 8px; }
.cc-pod {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 6px; flex: 1;
  border: 1px solid color-mix(in srgb, var(--ring) 35%, transparent);
  background: color-mix(in srgb, var(--ring) 8%, transparent);
  text-decoration: none; color: var(--text);
}
.cc-pod.is-me { box-shadow: inset 3px 0 0 #49f3d6; }
.cc-pod-place { font: 700 26px/1 Oswald, sans-serif; color: var(--ring); }
.cc-pod-body b { display: block; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-pod-body span { display: block; font-size: 11px; color: var(--text-faint); }
.cc-pod-value { font: 600 22px Oswald, sans-serif; color: var(--ring); }

/* --- строки таблиц --- */
.cc-rows { display: flex; flex-direction: column; margin-top: 14px; }
.cc-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 120px minmax(60px, 160px) 90px 80px;
  align-items: center; gap: 12px; padding: 8px 10px; border-radius: 4px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line-soft);
}
.cc-row:hover { background: rgba(255, 255, 255, 0.03); }
.cc-row.is-me { background: rgba(73, 243, 214, 0.08); box-shadow: inset 3px 0 0 #49f3d6; }
.cc-place { font: 600 15px Oswald, sans-serif; text-align: center; color: var(--text-faint); }
.cc-place-1 { color: #ffd166; }
.cc-place-2 { color: #dfe5df; }
.cc-place-3 { color: #d59a5c; }
.cc-nick { min-width: 0; }
.cc-nick > b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-nick-sub { display: none; font-size: 10.5px; color: var(--text-faint); }
.cc-role {
  display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 2px;
  font: 600 10px Inter, sans-serif; font-style: normal;
  color: var(--accent); background: rgba(255, 201, 77, 0.12);
}
.cc-spark-cell { display: flex; align-items: center; }
.cc-spark { display: block; }
.cc-spark-empty { display: block; height: 24px; }
.cc-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.cc-value { font: 600 15px Oswald, sans-serif; text-align: right; }
.cc-sub { font-size: 11.5px; color: var(--text-faint); text-align: right; white-space: nowrap; }
.cc-gap { text-align: center; color: var(--text-faint); font-size: 12px; padding: 2px 0; }
.cc-more {
  align-self: flex-start; margin-top: 10px; padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: 600 12.5px Inter, sans-serif; cursor: pointer; min-height: 40px;
}
.cc-more:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.cc-skipped { margin: 10px 0 0; font-size: 12px; color: var(--text-faint); }

/* --- неделя --- */
.cc-week-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cc-week-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.cc-chips {
  display: flex; gap: 4px; padding: 3px; border-radius: 6px; flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line-soft);
}
.cc-chip {
  padding: 6px 11px; border: 0; border-radius: 4px; background: transparent;
  color: var(--text-dim); font: 600 12px Inter, sans-serif; cursor: pointer;
}
.cc-chip:hover { color: var(--text); }
.cc-chip.is-on { background: var(--accent-grad); color: var(--accent-ink); }

/* --- «Я в сезоне» --- */
.cc-me {
  border-color: rgba(73, 243, 214, 0.35);
  background: linear-gradient(180deg, rgba(73, 243, 214, 0.08), transparent 40%), var(--surface);
}
.cc-me-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #49f3d6; }
.cc-me-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 8px; }
.cc-me-nick { font-size: 16px; font-weight: 800; }
.cc-me-gap { font-size: 12px; color: var(--text-dim); }
.cc-me-gap b { color: var(--text); }
.cc-me-place { font: 600 40px/1 Oswald, sans-serif; }
.cc-me-bar { height: 6px; border-radius: 3px; margin-top: 12px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.cc-me-bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(73, 243, 214, 0.5), #49f3d6); }
.cc-me-scale { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }
.cc-me-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.cc-me-tiles > div { padding: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.04); }
.cc-me-tiles span { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.cc-me-tiles b { display: block; font: 600 18px Oswald, sans-serif; }
.cc-me-tiles .is-up { color: var(--green); }
.cc-me-tiles .is-down { color: #ff7d6b; }
.cc-me-empty { margin: 8px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

/* --- история --- */
.cc-history { display: flex; flex-direction: column; gap: 10px; }
.cc-hist { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.025); }
.cc-hist-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cc-hist-title { font: 600 15px Oswald, sans-serif; letter-spacing: 0.02em; }
.cc-hist-meta { font-size: 11px; color: var(--text-faint); }
.cc-hist-top { display: flex; gap: 8px; margin-top: 10px; }
.cc-hist-cell {
  flex: 1; min-width: 0; padding: 8px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.03); border-top: 2px solid var(--ring);
  text-decoration: none; color: var(--text);
}
.cc-hist-cell.is-me { background: rgba(73, 243, 214, 0.1); }
.cc-hist-place { display: block; font: 700 11px Oswald, sans-serif; color: var(--ring); }
.cc-hist-nick { display: block; font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-hist-value { display: block; font: 600 13px Oswald, sans-serif; color: var(--accent); }
.cc-hist-prize { margin-top: 8px; font-size: 11.5px; color: var(--text-dim); }

/* --- лента --- */
.cc-feed { display: flex; flex-direction: column; }
.cc-feed-item {
  display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.cc-feed-edge { align-self: stretch; min-height: 28px; border-radius: 2px; }
.cc-feed-text { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.cc-feed-text b, .cc-feed-nick { color: var(--text); }
.cc-feed-nick { text-decoration: none; font-weight: 600; }
.cc-feed-item time { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

.cc-empty-season p { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.cc-btn {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px;
  padding: 0 18px; border-radius: var(--radius-sm);
  background: var(--accent-grad); color: var(--accent-ink); font-weight: 700; text-decoration: none;
}

/* ---------- узко: прячем то, что не помещается ---------- */
@media (max-width: 1180px) {
  .cc-wrap { grid-template-columns: minmax(0, 1fr); }
  .cc-rail { position: static; }
  .cc-season-body { grid-template-columns: minmax(0, 1fr); }
  .cc-row { grid-template-columns: 30px minmax(0, 1fr) 100px minmax(50px, 120px) 80px; }
  .cc-sub { display: none; }
}

@media (max-width: 900px) {
  /* Порядок как в 1e: сезон, «я», неделя, история, лента. */
  .cc-wrap { display: flex; flex-direction: column; gap: 12px; }
  .cc-main, .cc-rail { display: contents; }
  .cc-wrap .clan-panel { order: 3; }
  .cc-wrap .cc-season { order: 1; }
  .cc-wrap .cc-me { order: 2; }

  .cc-season-title { font-size: 24px; }
  .cc-season-head { flex-direction: column; }
  .cc-owner-btn { align-self: stretch; text-align: center; }
  .cc-chart { padding: 10px; }
  .cc-chart-svg { height: 90px; }
  .cc-chart-legend { display: none; }

  .cc-week-head { flex-direction: column; align-items: stretch; }
  .cc-chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    background: transparent; border: 0; padding: 0; gap: 6px;
    margin: 10px -14px 0; padding: 0 14px;
  }
  .cc-chips::-webkit-scrollbar { display: none; }
  .cc-chip {
    flex: none; min-height: 34px; padding: 0 12px; border-radius: 6px;
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
  }

  .cc-row { grid-template-columns: 24px minmax(0, 1fr) 56px 64px; gap: 8px; min-height: 48px; padding: 9px 6px; }
  .cc-bar { display: none; }
  .cc-spark-cell svg { width: 56px; height: 22px; }
  .cc-value { font-size: 16px; }
  .cc-nick > b { font-size: 13px; }
  .cc-nick-sub { display: block; }

  .cc-hist-top { flex-wrap: wrap; }
  .cc-feed-item { grid-template-columns: 3px minmax(0, 1fr); }
  .cc-feed-item time { grid-column: 2; font-size: 10.5px; }
  .cc-me-place { font-size: 30px; }
}
