/* Scoped visual upgrade: same electricBorder light pattern as live Founder Pass tickets.
   The approved article HTML, grade labels and programme rules are unchanged. */
@property --mtrfl-border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes mtrfl-electric-border { to { --mtrfl-border-angle: 360deg; } }

#mtr-founder-page.founder18 .grade-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
  margin: 30px 0;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(n) {
  --ticket-color: #deb477;
  --rank-width: 2px;
  --rank-speed: 5.8s;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 345px;
  padding: 22px 17px 20px;
  gap: 9px;
  border: var(--rank-width) solid color-mix(in srgb, var(--ticket-color) 52%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ticket-color) 17%, transparent), rgba(4, 8, 13, .12) 29%, rgba(4, 8, 13, .83) 66%, #04080d 100%),
    var(--grade-image) var(--grade-position, center) / cover no-repeat;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ticket-color) 18%, transparent),
    0 0 13px color-mix(in srgb, var(--ticket-color) 35%, transparent),
    0 0 30px color-mix(in srgb, var(--ticket-color) 10%, transparent);
  transition: transform .32s cubic-bezier(.22,1,.36,1), box-shadow .24s ease;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(1) {
  --ticket-color: #deb477; --rank-width: 3px; --rank-speed: 4.4s;
  --grade-image: url('artefact-game-still.jpg'); --grade-position: 47% center;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(2) {
  --ticket-color: #ad78e5; --rank-width: 2.5px; --rank-speed: 5.1s;
  --grade-image: url('poster-cinematic-characters.jpg'); --grade-position: 64% center;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(3) {
  --ticket-color: #dd666c; --rank-width: 2px; --rank-speed: 5.8s;
  --grade-image: url('character-game-still.jpg'); --grade-position: 48% center;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(4) {
  --ticket-color: #619ee3; --rank-width: 1.7px; --rank-speed: 6.4s;
  --grade-image: url('cinematic-poster.webp'); --grade-position: 57% center;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(5) {
  --ticket-color: #58bd87; --rank-width: 1.5px; --rank-speed: 7s;
  --grade-image: url('companion-scene.jpg'); --grade-position: 55% center;
}
#mtr-founder-page.founder18 .grade-strip > div > * {
  position: relative;
  z-index: 2;
}
#mtr-founder-page.founder18 .grade-strip b {
  display: block;
  margin: 0 auto auto 0;
  color: color-mix(in srgb, var(--ticket-color) 58%, white);
  font: 800 clamp(58px, 4.5vw, 82px)/.95 Poppins, Arial, sans-serif;
  text-shadow: 0 3px 18px rgba(0,0,0,.7), 0 0 28px color-mix(in srgb, var(--ticket-color) 24%, transparent);
}
#mtr-founder-page.founder18 .grade-strip b::after {
  content: 'GRADE';
  display: block;
  margin-top: 9px;
  font: 600 11px/1.2 Poppins, Arial, sans-serif;
  letter-spacing: .2em;
}
#mtr-founder-page.founder18 .grade-strip strong {
  margin-top: 46px;
  color: #f6f7f4;
  font: 700 17px/1.25 Poppins, Arial, sans-serif;
  letter-spacing: -.02em;
}
#mtr-founder-page.founder18 .grade-strip span {
  min-height: 54px;
  color: #c4cdd4;
  font: 400 12px/1.5 Poppins, Arial, sans-serif;
}

/* Shared Library: keep its existing responsive geometry and controls. */
body.mtr-founder-live.has-library #mtr-founder-page .library-nav,
body.mtr-founder-live .library-launcher {
  --ticket-color: #deb477;
  --rank-width: 2px;
  --rank-speed: 4.4s;
  isolation: isolate;
  border-color: rgba(222,180,119,.5);
  box-shadow: inset 0 0 0 1px rgba(222,180,119,.18), 0 0 15px rgba(222,180,119,.3), 0 0 36px rgba(222,180,119,.1);
}
body.mtr-founder-live .library-edge-light { display: none; }
body.mtr-founder-live .library-book { color: #deb477; }

/* These stops and the white flash match the live ticket effect. */
#mtr-founder-page.founder18 .grade-strip > div::before,
body.mtr-founder-live.has-library #mtr-founder-page .library-nav::before,
body.mtr-founder-live .library-launcher::before {
  content: '';
  position: absolute;
  z-index: 5;
  inset: 0;
  padding: var(--rank-width);
  border-radius: inherit;
  pointer-events: none;
  opacity: .92;
  background: conic-gradient(from var(--mtrfl-border-angle),
    transparent 0 38%,
    color-mix(in srgb, var(--ticket-color) 80%, white) 46%,
    #fff 49%,
    color-mix(in srgb, var(--ticket-color) 86%, white) 52%,
    transparent 60% 82%,
    color-mix(in srgb, var(--ticket-color) 68%, white) 88%,
    transparent 94% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--ticket-color) 58%, transparent));
  animation: mtrfl-electric-border var(--rank-speed) linear infinite;
  animation-play-state: paused;
}
#mtr-founder-page.founder18 .grade-strip > .mtrfl-light-visible::before,
body.mtr-founder-live.has-library #mtr-founder-page .library-nav.mtrfl-light-visible::before,
body.mtr-founder-live .library-launcher.mtrfl-light-visible::before { animation-play-state: running; }
#mtr-founder-page.founder18 .grade-strip > div::after {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px circle at var(--mouse-x,50%) var(--mouse-y,50%), color-mix(in srgb, var(--ticket-color) 22%, transparent), transparent 62%);
  mix-blend-mode: screen;
  transition: opacity .22s ease;
}
@media (hover:hover) {
  #mtr-founder-page.founder18 .grade-strip > div:hover { transform: translateY(-5px); }
  #mtr-founder-page.founder18 .grade-strip > div:hover::after { opacity: 1; }
}
@media (min-width:1900px) {
  body.mtr-founder-live.has-library #mtr-founder-page .library-nav { top: calc(var(--wp-admin--admin-bar--height,0px) + 112px); max-height: calc(100dvh - var(--wp-admin--admin-bar--height,0px) - 136px); box-shadow: inset 0 0 0 1px rgba(222,180,119,.18), 0 0 15px rgba(222,180,119,.3), 0 0 36px rgba(222,180,119,.1); }
}
@media (max-width:820px) {
  #mtr-founder-page.founder18 .grade-strip { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
  #mtr-founder-page.founder18 .grade-strip > div { min-height: 315px; }
}
@media (max-width:560px) {
  #mtr-founder-page.founder18 .grade-strip { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 12px; }
  #mtr-founder-page.founder18 .grade-strip > div { min-height: 295px; padding: 18px 13px 15px; }
  #mtr-founder-page.founder18 .grade-strip b { font-size: 62px; }
  #mtr-founder-page.founder18 .grade-strip strong { font-size: 15px; }
  #mtr-founder-page.founder18 .grade-strip span { min-height: 54px; font-size: 11px; }
}
@media (prefers-reduced-motion:reduce) {
  #mtr-founder-page.founder18 .grade-strip > div,
  #mtr-founder-page.founder18 .grade-strip > div::after { transition: none; transform: none; }
  #mtr-founder-page.founder18 .grade-strip > div::before,
  body.mtr-founder-live.has-library #mtr-founder-page .library-nav::before,
  body.mtr-founder-live .library-launcher::before { animation: none; }
}

/* Product Owner correction: the grade is the entire visual focus. */
#mtr-founder-page.founder18 .grade-strip > div:nth-child(n) {
  min-height: 0;
  height: auto;
  aspect-ratio: 1;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: 1fr;
  justify-content: stretch;
  align-content: stretch;
  place-items: center;
  gap: 0;
  background: var(--grade-fill);
  border-radius: 14px;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(1) {
  --grade-fill: radial-gradient(ellipse at 27% 14%,#fae6a5 0%,#e6bf55 46%,#bd8b2f 100%);
  --grade-ink: #2b1b08;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(2) {
  --grade-fill: radial-gradient(ellipse at 27% 14%,#996ad2 0%,#65429b 48%,#39294f 100%);
  --grade-ink: #f5eaff;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(3) {
  --grade-fill: radial-gradient(ellipse at 27% 14%,#c56770 0%,#883b4a 48%,#46232e 100%);
  --grade-ink: #fff0f0;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(4) {
  --grade-fill: radial-gradient(ellipse at 27% 14%,#5993cf 0%,#2d5b92 48%,#1a334f 100%);
  --grade-ink: #edf7ff;
}
#mtr-founder-page.founder18 .grade-strip > div:nth-child(5) {
  --grade-fill: radial-gradient(ellipse at 27% 14%,#5ab586 0%,#2c7655 48%,#1b4135 100%);
  --grade-ink: #ecfff4;
}
#mtr-founder-page.founder18 .grade-strip b {
  margin: 0;
  width: 100%;
  text-align: center;
  color: var(--grade-ink);
  font: 800 clamp(64px,5vw,96px)/.9 Poppins,Arial,sans-serif;
  letter-spacing: -.045em;
  text-shadow: 0 2px 16px rgba(0,0,0,.12);
}
#mtr-founder-page.founder18 .grade-strip b::after {
  content: 'GRADE';
  margin-top: 14px;
  color: inherit;
  font: 600 clamp(14px,1.15vw,19px)/1 Poppins,Arial,sans-serif;
  letter-spacing: .15em;
}
#mtr-founder-page.founder18 .grade-strip strong,
#mtr-founder-page.founder18 .grade-strip span { display: none; }
@media(max-width:560px) {
  #mtr-founder-page.founder18 .grade-strip > div:last-child {
    grid-column: 1 / -1;
    width: calc((100% - 12px) / 2);
    justify-self: center;
  }
}
