/*
 * ============================================================
 * BOOM RAID NATIVE V2
 * Portal-native Raid page. No iframe, no Stadium dependency.
 * ============================================================
 */

.portal-raid-native {
  --raid-red: #ff556d;
  --raid-orange: #ff9a55;
  --raid-cyan: #59e4f2;
  --raid-green: #5cf2aa;
  --raid-gold: #ffd968;
  --raid-line: rgba(96, 207, 225, .18);

  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 0 0 34px;
}

.raid-native-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 14px;
}

.raid-native-header h1 {
  margin: 5px 0 4px;
  color: #f2fbff;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: .88;
  letter-spacing: -.055em;
}

.raid-native-header h1 b {
  color: var(--raid-red);
  text-shadow: 0 0 28px rgba(255,85,109,.2);
}

.raid-native-header p {
  max-width: 760px;
  margin: 0;
  color: #819ba6;
  font-size: .88rem;
}

.raid-native-back {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid rgba(89,228,242,.3);
  border-radius: 11px;
  background: rgba(5,20,28,.84);
  color: #76eef8;
  font: 900 .54rem/1 Orbitron, sans-serif;
  letter-spacing: .08em;
  text-decoration: none;
}

.raid-native-stage {
  position: relative;
  min-height: 490px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  overflow: hidden;
  border: 1px solid rgba(255,97,117,.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 79% 50%, rgba(255,78,104,.15), transparent 31%),
    radial-gradient(circle at 22% 12%, rgba(85,225,239,.11), transparent 31%),
    linear-gradient(135deg, #07151d 0%, #071017 49%, #170b12 100%);
  box-shadow:
    0 24px 70px rgba(0,0,0,.28),
    inset 0 0 0 1px rgba(255,255,255,.018);
  isolation: isolate;
}

.raid-native-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .32;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(75,179,194,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75,179,194,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, #000, transparent 80%);
}

.raid-native-stage__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.raid-native-stage__scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10%;
  height: 22%;
  opacity: .13;
  background:
    linear-gradient(
      transparent,
      rgba(90,232,245,.55),
      transparent
    );
  animation: raidNativeScan 6s linear infinite;
}

@keyframes raidNativeScan {
  to { transform: translateY(520%); }
}

.raid-native-stage__copy {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: clamp(28px, 5vw, 64px);
}

.raid-native-live {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0 10px;
  border: 1px solid rgba(255,90,112,.38);
  border-radius: 999px;
  background: rgba(85,11,24,.45);
  color: #ff7184;
  font: 950 .49rem/1 Orbitron, sans-serif;
  letter-spacing: .12em;
}

.raid-native-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--raid-red);
  box-shadow: 0 0 14px var(--raid-red);
  animation: raidPulse 1.2s ease-in-out infinite;
}

.raid-native-live.is-idle {
  border-color: rgba(88,226,239,.25);
  background: rgba(8,47,56,.35);
  color: #79eaf4;
}

.raid-native-live.is-idle i {
  background: #5fe5ef;
  box-shadow: 0 0 14px rgba(95,229,239,.8);
}

@keyframes raidPulse {
  50% { opacity: .28; }
}

.raid-native-kicker {
  display: block;
  color: var(--raid-cyan);
  font: 950 .52rem/1.2 Orbitron, sans-serif;
  letter-spacing: .13em;
}

.raid-native-stage__copy h1 {
  max-width: 720px;
  margin: 8px 0 14px;
  color: #f2f8fa;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: .86;
  letter-spacing: -.06em;
}

.raid-native-stage__copy h1 b {
  color: #7b919a;
}

.raid-native-stage__copy > p {
  max-width: 610px;
  margin: 0;
  color: #91a5ad;
  font-size: clamp(.86rem, 1.3vw, 1rem);
  line-height: 1.5;
}

.raid-native-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.raid-native-meta span {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(89,228,242,.2);
  border-radius: 8px;
  background: rgba(4,20,28,.65);
  color: #aac0c7;
  font: 900 .49rem/1 Orbitron, sans-serif;
}

.raid-native-meta span:last-child {
  color: #ffcf67;
}

.raid-native-hp {
  max-width: 660px;
  margin-top: 24px;
}

.raid-native-hp > div {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.raid-native-hp > div span {
  color: #8299a2;
  font: 900 .48rem/1 Orbitron, sans-serif;
  letter-spacing: .12em;
}

.raid-native-hp > div strong {
  color: #f7fbfc;
  font: 950 .82rem/1 Orbitron, sans-serif;
}

.raid-native-hp > i {
  height: 16px;
  margin-top: 7px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255,101,121,.32);
  border-radius: 999px;
  background: rgba(12,22,27,.95);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.45);
}

.raid-native-hp > i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--raid-red), var(--raid-orange));
  box-shadow:
    0 0 20px rgba(255,88,107,.48);
  transition: width .35s ease;
}

.raid-native-prize,
.raid-native-last {
  max-width: 660px;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(255,213,99,.2);
  border-radius: 10px;
  background: rgba(41,30,8,.42);
}

.raid-native-prize span,
.raid-native-last span {
  display: block;
  margin-bottom: 4px;
  color: #aa955c;
  font: 900 .45rem/1 Orbitron, sans-serif;
  letter-spacing: .1em;
}

.raid-native-prize strong,
.raid-native-last strong {
  color: #ffdc78;
  font-size: .8rem;
}

.raid-native-stage__boss {
  position: relative;
  min-height: 490px;
  display: grid;
  place-items: center;
  z-index: 2;
}

.raid-native-stage__boss img {
  position: relative;
  z-index: 4;
  width: min(72%, 520px);
  max-height: 430px;
  object-fit: contain;
  filter:
    drop-shadow(0 26px 20px rgba(0,0,0,.45))
    drop-shadow(0 0 38px rgba(255,76,102,.26));
  animation: raidBossFloat 4.2s ease-in-out infinite;
}

@keyframes raidBossFloat {
  50% { transform: translateY(-10px); }
}

.raid-native-boss-number {
  position: absolute;
  right: 9%;
  top: 11%;
  z-index: 5;
  color: rgba(255,255,255,.18);
  font: 950 clamp(2rem, 5vw, 5rem)/1 Orbitron, sans-serif;
}

.raid-native-orbit {
  position: absolute;
  width: min(72%, 450px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,83,109,.18);
  border-radius: 50%;
  box-shadow:
    0 0 70px rgba(255,73,100,.1),
    inset 0 0 50px rgba(255,73,100,.06);
  animation: raidOrbit 14s linear infinite;
}

.raid-native-orbit::before,
.raid-native-orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(91,229,242,.2);
  border-radius: 50%;
}

.raid-native-orbit::after {
  inset: 30%;
  border-style: solid;
}

.raid-native-orbit--two {
  width: min(52%, 330px);
  animation-direction: reverse;
  animation-duration: 9s;
}

@keyframes raidOrbit {
  to { transform: rotate(360deg); }
}

.raid-native-radar {
  position: relative;
  z-index: 5;
  width: min(62%, 310px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(83,224,238,.22);
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle,
      transparent 0 24px,
      rgba(83,224,238,.08) 25px 26px
    );
}

.raid-native-radar::after {
  content: "";
  position: absolute;
  width: 48%;
  height: 1px;
  left: 50%;
  top: 50%;
  transform-origin: left center;
  background:
    linear-gradient(90deg, rgba(90,232,244,.9), transparent);
  animation: raidRadar 3s linear infinite;
}

@keyframes raidRadar {
  to { transform: rotate(360deg); }
}

.raid-native-radar i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #63e8f2;
  box-shadow: 0 0 12px #63e8f2;
}

.raid-native-radar i:nth-child(1) {
  left: 27%;
  top: 35%;
}

.raid-native-radar i:nth-child(2) {
  right: 21%;
  top: 49%;
}

.raid-native-radar i:nth-child(3) {
  left: 47%;
  bottom: 22%;
}

.raid-native-radar span {
  color: #7cebf4;
  font: 950 .55rem/1 Orbitron, sans-serif;
  letter-spacing: .12em;
}

.raid-native-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 12px;
}

.raid-native-side {
  display: grid;
  gap: 12px;
}

.raid-native-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--raid-line);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(6,22,29,.97), rgba(4,13,19,.98));
  box-shadow:
    0 14px 38px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.012);
}

.raid-native-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.raid-native-card h2,
.raid-native-card h3 {
  margin: 5px 0 0;
  color: #eef8fa;
  font-family: Orbitron, sans-serif;
  line-height: 1;
}

.raid-native-card h2 {
  font-size: clamp(1rem, 2vw, 1.5rem);
}

.raid-native-card h3 {
  font-size: .83rem;
}

.raid-native-online {
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(86,239,170,.2);
  border-radius: 8px;
  background: rgba(12,65,44,.28);
  color: #6df1b3;
  font: 900 .43rem/1 Orbitron, sans-serif;
}

.raid-damage-list {
  display: grid;
  gap: 8px;
}

.raid-damage-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(92,164,178,.12);
  border-radius: 10px;
  background: rgba(5,17,23,.72);
}

.raid-damage-row.is-you {
  border-color: rgba(255,212,102,.38);
  background: rgba(45,34,9,.35);
}

.raid-damage-row__rank {
  color: #6f8992;
  font: 900 .5rem/1 Orbitron, sans-serif;
}

.raid-damage-row__trainer {
  min-width: 0;
}

.raid-damage-row__trainer strong {
  display: block;
  overflow: hidden;
  color: #e9f6f8;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raid-damage-row__trainer i {
  height: 4px;
  margin-top: 5px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #10242b;
}

.raid-damage-row__trainer i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #52dbe9, #67f2b3);
}

.raid-damage-row__value {
  color: #76e9f1;
  font: 900 .5rem/1 Orbitron, sans-serif;
}

.raid-trainer-stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 7px;
}

.raid-trainer-stats > div {
  min-height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(86,172,186,.14);
  border-radius: 10px;
  background: rgba(6,20,27,.72);
}

.raid-trainer-stats strong {
  color: #eef9fa;
  font: 950 1rem/1 Orbitron, sans-serif;
}

.raid-trainer-stats span {
  margin-top: 5px;
  color: #69848e;
  font: 900 .4rem/1 Orbitron, sans-serif;
  letter-spacing: .08em;
}

.raid-native-trainer > p {
  margin: 12px 0 0;
  color: #7f969f;
  font-size: .72rem;
  line-height: 1.45;
}

.raid-how-grid {
  margin-top: 13px;
  display: grid;
  gap: 7px;
}

.raid-how-grid article {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-content: center;
  padding: 9px;
  border: 1px solid rgba(89,228,242,.12);
  border-radius: 9px;
  background: rgba(4,17,23,.72);
}

.raid-how-grid article b {
  grid-row: 1 / 3;
  align-self: center;
  color: #405e68;
  font: 950 .66rem/1 Orbitron, sans-serif;
}

.raid-how-grid article strong {
  color: #eaf8fa;
  font: 900 .58rem/1.1 Orbitron, sans-serif;
}

.raid-how-grid article span {
  margin-top: 3px;
  color: #78919a;
  font-size: .68rem;
}

.raid-how-note {
  margin: 11px 0 0;
  color: #71868e;
  font-size: .67rem;
  line-height: 1.45;
}

.raid-native-history-wide {
  margin-top: 12px;
}

.raid-history-list {
  display: grid;
  gap: 7px;
}

.raid-history-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(180px,1fr) minmax(150px,.45fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(84,154,168,.12);
  border-radius: 10px;
  background: rgba(4,16,22,.7);
}

.raid-history-row__rank {
  color: #516b74;
  font: 900 .48rem/1 Orbitron, sans-serif;
}

.raid-history-row__boss {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.raid-history-row__sprite {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
}

.raid-history-row__sprite img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.raid-history-row__boss strong,
.raid-history-row__boss small,
.raid-history-row__winner span,
.raid-history-row__winner strong {
  display: block;
}

.raid-history-row__boss strong {
  color: #edf8fa;
  font-size: .73rem;
}

.raid-history-row__boss small {
  margin-top: 2px;
  color: #667f88;
  font-size: .61rem;
}

.raid-history-row__winner span {
  color: #607980;
  font: 900 .38rem/1 Orbitron, sans-serif;
  letter-spacing: .08em;
}

.raid-history-row__winner strong {
  margin-top: 4px;
  color: #ffd76f;
  font-size: .68rem;
}

.raid-history-row__time {
  color: #617981;
  font-size: .63rem;
  text-align: right;
}

.raid-native-empty {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(87,172,184,.16);
  border-radius: 10px;
  color: #607881;
  font-size: .68rem;
}

.raid-native-loading {
  min-height: 440px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(89,228,242,.14);
  border-radius: 20px;
  background: rgba(4,16,23,.8);
  color: #80e9f1;
  font: 900 .58rem/1 Orbitron, sans-serif;
  letter-spacing: .1em;
}

.raid-native-loading i {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(88,229,240,.16);
  border-top-color: #66e8f2;
  border-radius: 50%;
  animation: raidOrbit .8s linear infinite;
}

@media (max-width: 1050px) {
  .raid-native-stage {
    grid-template-columns: 1fr 46%;
  }

  .raid-native-grid {
    grid-template-columns: 1fr;
  }

  .raid-native-side {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 760px) {
  .portal-raid-native {
    padding-bottom: 88px;
  }

  .raid-native-header {
    align-items: flex-start;
  }

  .raid-native-header h1 {
    font-size: clamp(2rem, 13vw, 3.4rem);
  }

  .raid-native-stage {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .raid-native-stage__copy {
    padding: 24px 18px 0;
  }

  .raid-native-stage__copy h1 {
    font-size: clamp(2.5rem, 15vw, 4.4rem);
  }

  .raid-native-stage__boss {
    min-height: 330px;
  }

  .raid-native-stage__boss img {
    width: min(70%, 330px);
    max-height: 300px;
  }

  .raid-native-stage__boss--idle {
    min-height: 280px;
  }

  .raid-native-side {
    grid-template-columns: 1fr;
  }

  .raid-history-row {
    grid-template-columns: 28px minmax(0,1fr) auto;
  }

  .raid-history-row__winner {
    display: none;
  }

  .raid-native-history-wide {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .raid-native-header {
    display: block;
  }

  .raid-native-back {
    margin-top: 12px;
  }

  .raid-native-card {
    padding: 13px;
  }

  .raid-native-stage {
    border-radius: 17px;
  }

  .raid-native-stage__copy {
    padding-inline: 14px;
  }

  .raid-native-meta {
    gap: 5px;
  }

  .raid-native-meta span {
    min-height: 28px;
    padding-inline: 8px;
    font-size: .42rem;
  }

  .raid-damage-row {
    grid-template-columns: 28px minmax(0,1fr);
  }

  .raid-damage-row__value {
    grid-column: 2;
  }

  .raid-history-row {
    min-height: 58px;
    padding: 7px;
  }

  .raid-history-row__sprite {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .raid-history-row__time {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-raid-native *,
  .portal-raid-native *::before,
  .portal-raid-native *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
