/* ============================================================
   SkinSignal / the calling cards page, signed out
   renderPublic in js/achievements.js. Every rule is scoped to the
   showcase (.cards--public, set only while nobody is signed in, and the
   .ccp / .cc-* classes only it draws), so the signed in collection is
   exactly as css/achievements.css draws it.

   THE CALLING CARD ARTWORK (.cc-art) is the one treatment for card art
   here: the full width it is given, a 3:1 box, the whole card contained.
   Never cropped, never stretched, never dimmed.

   The art leads. Colour is a whisper on each set's edge: legendary gold,
   epic violet, rare blue, common steel, ranks prestige blue.
   ============================================================ */

/* The signed in header block and its plate step aside for the showcase. */
.cards--public .cards-head { display: none; }

.ccp {
  --ccp-gold: #e4ae39;
  --ccp-blue: 76, 141, 255;
  --ccp-ink: #f4f6fa;
  --ccp-ink-2: #b9bfca;
  --ccp-ink-3: #8a919e;
  position: relative;
  padding: clamp(28px, 3vw, 48px) 0 clamp(48px, 5vw, 80px);
  /* The fan's tilted corners never widen the page. */
  overflow-x: clip;
}
.ccp .container { max-width: 1440px; }

.ccp-eyebrow {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ccp-gold);
}
.ccp-eyebrow--blue { color: #8fb6ff; }
.ccp-gold { color: var(--ccp-gold); }

/* ---------- THE CALLING CARD ARTWORK ---------- */
.cc-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: #0b0e14;
}
.cc-art picture,
.cc-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cc-art img[data-src]:not([src]) { visibility: hidden; }
.cc-art img { opacity: 0; transition: opacity 320ms ease; }
.cc-art img.is-loaded { opacity: 1; }

/* ============================================================
   THE HERO
   ============================================================ */
.ccp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) minmax(0, 0.74fr);
  align-items: center;
  gap: clamp(20px, 2.4vw, 40px);
}
.ccp-title {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 800;
  font-size: clamp(38px, 4.1vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ccp-ink);
}
.ccp-title__line { display: block; white-space: nowrap; }
.ccp-lede {
  max-width: 560px;
  margin: 20px 0 0;
  font-family: var(--font-body);
  font-size: clamp(15.5px, 1.05vw, 18px);
  line-height: 1.6;
  color: #c3c9d3;
}
.ccp-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.2vw, 20px);
  margin: clamp(24px, 2.4vw, 36px) 0 0;
  padding: 0;
  list-style: none;
}
.ccp-pr { --pr: 76, 141, 255; display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.ccp-pr--gold { --pr: 228, 174, 57; }
.ccp-pr__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--pr), 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(var(--pr), 0.1), rgba(var(--pr), 0.02));
}
.ccp-pr__icon svg { width: 21px; height: 21px; fill: none; stroke: rgb(var(--pr)); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ccp-pr__text { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--ccp-ink-3); }
.ccp-pr__text b {
  display: block;
  margin-bottom: 5px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 10.5px;
  line-height: 1.45;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #eef1f6;
}
.ccp-pr__text b span { margin-right: 8px; color: rgb(var(--pr)); }

/* The fan: real cards laid over each other by position, never cropped. */
.ccp-fan {
  position: relative;
  min-height: clamp(300px, 26vw, 400px);
}
.ccp-fan__light {
  position: absolute;
  inset: -8% -6%;
  pointer-events: none;
  background:
    radial-gradient(40% 40% at 45% 40%, rgba(228, 174, 57, 0.14), rgba(228, 174, 57, 0) 70%),
    radial-gradient(50% 50% at 55% 62%, rgba(61, 127, 255, 0.14), rgba(61, 127, 255, 0) 72%),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.02) 39px 40px),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, 0.015) 39px 40px);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent);
          mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent);
}
.ccp-fan__card {
  --edge: 255, 255, 255;
  position: absolute;
  width: 62%;
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(var(--edge), 0.55), 0 22px 44px -16px rgba(0, 0, 0, 0.95), 0 0 30px -10px rgba(var(--edge), 0.4);
  transform: rotate(var(--r, 0deg));
}
.ccp-fan__card--legendary { --edge: 240, 180, 41; }
.ccp-fan__card--epic { --edge: 163, 91, 255; }
.ccp-fan__card--rare { --edge: 76, 141, 255; }
.ccp-fan__card--rank { --edge: 96, 150, 255; }
.ccp-fan__card--common { --edge: 170, 180, 196; }
/* Seven places, back to front: a cascade falling left to right. */
.ccp-fan__card:nth-child(2) { left: 0%;  top: 2%;  --r: -9deg; }
.ccp-fan__card:nth-child(3) { left: 30%; top: 0%;  --r: 6deg; }
.ccp-fan__card:nth-child(4) { left: 8%;  top: 24%; --r: -5deg; }
.ccp-fan__card:nth-child(5) { left: 36%; top: 22%; --r: 8deg; }
.ccp-fan__card:nth-child(6) { left: 2%;  top: 48%; --r: -3deg; }
.ccp-fan__card:nth-child(7) { left: 36%; top: 50%; --r: 5deg; }
.ccp-fan__card:nth-child(8) { left: 16%; top: 64%; --r: -1deg; width: 70%; box-shadow: 0 0 0 1px rgba(var(--edge), 0.8), 0 30px 60px -18px rgba(0, 0, 0, 1), 0 0 44px -8px rgba(var(--edge), 0.5); }

/* The sign in panel. */
.ccp-panel {
  position: relative;
  padding: clamp(22px, 2vw, 30px);
  border: 1px solid rgba(var(--ccp-blue), 0.3);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(14, 21, 36, 0.95), rgba(7, 11, 20, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 60px -26px rgba(61, 127, 255, 0.5), 0 40px 80px -40px rgba(0, 0, 0, 0.95);
}
.ccp-panel::after {
  content: '';
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228, 174, 57, 0.7), transparent);
}
.ccp-panel__title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 800;
  font-size: clamp(24px, 1.9vw, 32px);
  line-height: 1.08;
  color: var(--ccp-ink);
}
.ccp-panel__title > span { display: block; }
.ccp-panel__line { margin: 12px 0 20px; font-family: var(--font-body); font-size: 14.5px; line-height: 1.55; color: var(--ccp-ink-2); }
.ccp-panel .ccp-cta { width: 100%; justify-content: center; }

.ccp-trust {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ccp-ink-2);
}
.ccp-trust li { display: flex; align-items: center; gap: 8px; }
.ccp-trust svg { width: 17px; height: 17px; flex: none; fill: none; stroke: #4c8dff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   THE FIVE SETS
   ============================================================ */
.ccp-rows {
  display: grid;
  gap: 12px;
  margin-top: clamp(28px, 3vw, 48px);
}
.ccp-row {
  --set: 170, 180, 196;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(var(--set), 0.1) 0%, rgba(var(--set), 0) 20%),
    linear-gradient(180deg, rgba(14, 19, 30, 0.94), rgba(8, 11, 18, 0.96));
  box-shadow: inset 1px 0 0 rgba(var(--set), 0.85), 0 24px 50px -36px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}
.ccp-row--legendary { --set: 228, 174, 57; }
.ccp-row--epic { --set: 163, 91, 255; }
.ccp-row--rare { --set: 76, 141, 255; }
.ccp-row--common { --set: 170, 180, 196; }
.ccp-row--rank { --set: 96, 150, 255; }

.ccp-row__bar {
  display: grid;
  grid-template-columns: auto minmax(160px, 0.9fr) minmax(0, 3.4fr) auto auto;
  align-items: center;
  gap: clamp(14px, 1.4vw, 24px);
  padding: 14px clamp(16px, 1.6vw, 24px) 14px clamp(18px, 1.8vw, 26px);
}
/* A small diamond in the set's colour: identity, not decoration. */
.ccp-row__mark {
  width: 22px;
  height: 22px;
  rotate: 45deg;
  border: 1.5px solid rgba(var(--set), 0.95);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(var(--set), 0.35), rgba(var(--set), 0.05));
  box-shadow: 0 0 16px -4px rgba(var(--set), 0.7);
}
.ccp-row__title {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 800;
  font-size: clamp(20px, 1.5vw, 26px);
  line-height: 1.1;
  color: var(--ccp-ink);
}
.ccp-row__line { margin: 4px 0 0; font-family: var(--font-body); font-size: 13px; line-height: 1.45; color: var(--ccp-ink-3); }
.ccp-row__peek {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.ccp-row__peek-card .cc-art { box-shadow: 0 0 0 1px rgba(var(--set), 0.4), 0 10px 24px -14px rgba(0, 0, 0, 0.9); }
.ccp-row__count {
  display: grid;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(var(--set), 0.4);
  border-radius: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ccp-ink-3);
  white-space: nowrap;
}
.ccp-row__count b { font-size: 16px; font-weight: 600; color: rgb(var(--set)); }
.ccp-row__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ccp-ink);
  cursor: pointer;
  transition: border-color var(--hover-dur, 200ms) ease, background-color var(--hover-dur, 200ms) ease;
}
.ccp-row__toggle:hover { border-color: rgba(var(--set), 0.6); background: rgba(var(--set), 0.06); }
.ccp-row__toggle:focus-visible { outline: 2px solid rgba(118, 166, 255, 0.85); outline-offset: 2px; }
.ccp-row__toggle svg { width: 10px; height: 6px; transition: rotate var(--hover-dur, 200ms) ease; }
.ccp-row__toggle-on { display: none; }
.ccp-row__toggle[aria-expanded="true"] .ccp-row__toggle-on { display: inline; }
.ccp-row__toggle[aria-expanded="true"] .ccp-row__toggle-off { display: none; }
.ccp-row__toggle[aria-expanded="true"] svg { rotate: 180deg; }

.ccp-row__body { padding: 4px clamp(16px, 1.8vw, 26px) clamp(18px, 1.8vw, 26px); border-top: 1px solid rgba(255, 255, 255, 0.05); }
.ccp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.cc-tile {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: translate var(--hover-dur, 200ms) var(--ease);
}
.cc-tile .cc-art { box-shadow: 0 0 0 1px rgba(var(--set), 0.35), 0 12px 28px -16px rgba(0, 0, 0, 0.9); transition: box-shadow var(--hover-dur, 200ms) ease, filter var(--hover-dur, 200ms) ease; }
.cc-tile__name { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--ccp-ink-2); transition: color var(--hover-dur, 200ms) ease; }
.cc-tile:hover { translate: 0 var(--hover-lift, -2px); }
.cc-tile:hover .cc-art { box-shadow: 0 0 0 1px rgba(var(--set), 0.75), 0 18px 34px -16px rgba(0, 0, 0, 0.95); filter: brightness(1.08); }
.cc-tile:hover .cc-tile__name { color: #ffffff; }
.cc-tile:focus-visible { outline: 2px solid rgba(118, 166, 255, 0.85); outline-offset: 4px; border-radius: 6px; }

/* ============================================================
   HOW THEY ARE EARNED, and THE CLOSE
   ============================================================ */
.ccp-story {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(24px, 2.6vw, 40px);
  padding: 18px clamp(18px, 2vw, 28px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ccp-story__k {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8fb6ff;
}
.ccp-story__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ccp-ink-3);
}
.ccp-story__list b { display: block; margin-bottom: 2px; font-size: 13.5px; color: var(--ccp-ink); }
.ccp-story__gold {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ccp-gold);
  white-space: nowrap;
}

.ccp-close {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.6fr);
  align-items: center;
  gap: clamp(18px, 2.4vw, 40px);
  margin-top: clamp(24px, 2.6vw, 40px);
  padding: clamp(26px, 2.6vw, 40px);
  border: 1px solid rgba(228, 174, 57, 0.32);
  border-radius: 20px;
  background:
    radial-gradient(40% 90% at 50% 50%, rgba(61, 127, 255, 0.07), rgba(61, 127, 255, 0) 70%),
    linear-gradient(180deg, rgba(14, 18, 28, 0.95), rgba(7, 10, 16, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.06), 0 40px 90px -50px rgba(0, 0, 0, 0.95);
}
.ccp-close__title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 800;
  font-size: clamp(32px, 3.2vw, 52px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ccp-ink);
}
.ccp-close__line { max-width: 560px; margin: 14px 0 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--ccp-ink-2); }
.ccp-close__act { display: grid; justify-items: center; gap: 16px; }
.ccp-close__act .ccp-cta { width: 100%; justify-content: center; }
.ccp-close__act .ccp-trust { grid-auto-flow: column; justify-content: center; gap: 8px 18px; margin: 0; }
.ccp-close__mini {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.6);
}
.ccp-close__mini-k {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ccp-ink);
}
.ccp-close__mini-line { margin: 8px 0 0; font-family: var(--font-body); font-size: 13.5px; line-height: 1.5; color: var(--ccp-ink-3); }

/* ============================================================
   NARROWER
   ============================================================ */
@media (max-width: 1279px) {
  .ccp-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ccp-panel { grid-column: 1 / -1; }
  .ccp-row__bar { grid-template-columns: auto minmax(140px, 1fr) minmax(0, 2.4fr) auto auto; }
  .ccp-row__peek { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ccp-row__peek-card:nth-child(4) { display: none; }
  .ccp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ccp-close { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ccp-close__mini { grid-column: 1 / -1; }
}

/* Tablet: the copy, then the fan; the rows put their peek on a line of
   its own; the grid three across. */
@media (max-width: 900px) {
  .ccp-hero { grid-template-columns: minmax(0, 1fr); }
  .ccp-fan { min-height: 0; aspect-ratio: 16 / 11; max-width: 620px; width: 100%; margin: 0 auto; }
  .ccp-principles { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ccp-row__bar { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .ccp-row__peek { grid-column: 1 / -1; grid-row: 2; }
  .ccp-story { grid-template-columns: minmax(0, 1fr); }
  .ccp-story__list { grid-template-columns: minmax(0, 1fr); }
  .ccp-close { grid-template-columns: minmax(0, 1fr); }
  .ccp-close__act .ccp-trust { grid-auto-flow: row; justify-items: center; }
}

/* Phones: two cards across in a peek, one in the full set, so the art
   stays readable. */
@media (max-width: 560px) {
  .ccp-title { font-size: clamp(34px, 10vw, 44px); }
  .ccp-title__line { white-space: normal; }
  .ccp-row__bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ccp-row__count { grid-column: 2; grid-row: 3; justify-self: start; }
  .ccp-row__toggle { grid-column: 3; grid-row: 3; }
  .ccp-row__peek { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ccp-row__peek-card:nth-child(3) { display: none; }
  .ccp-grid { grid-template-columns: minmax(0, 1fr); }
  .ccp-close__act .ccp-cta { height: 60px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-art img,
  .cc-tile,
  .cc-tile .cc-art,
  .cc-tile__name,
  .ccp-row__toggle,
  .ccp-row__toggle svg { transition: none; }
  .cc-tile:hover { translate: none; }
}
