/* —— PvP Arena —— */
.ar {
  --cream: #f7f1e4;
  --gold: #f6c445;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #071426;
  color: var(--cream);
  font-family: var(--font);
  user-select: none;
}
.ar button { -webkit-tap-highlight-color: transparent; }
.ar svg { display: block; flex-shrink: 0; }

.ar-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  background: linear-gradient(180deg, #0c1830, #081222);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 3;
}
.ar-top h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  color: #fff;
}
.ar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #dce6f5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ar-icon-btn svg { width: 22px; height: 22px; }
.ar-icon-btn:active { transform: scale(0.95); }

.ar-hero {
  position: relative;
  flex: 0 0 auto;
  height: clamp(210px, 36dvh, 268px);
  overflow: hidden;
  background: #0a2038;
}
.ar-banner {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  max-width: none;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
  filter: saturate(1.2) brightness(1.08) contrast(1.05) blur(1.2px);
  transform: scale(1.04);
}
.ar-hero-glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(78vw, 320px);
  height: min(78vw, 320px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 90, 0.35) 0%, rgba(80, 160, 255, 0.12) 42%, transparent 70%);
  pointer-events: none;
}
.ar-hero.league-silver .ar-hero-glow {
  background: radial-gradient(circle, rgba(200, 220, 255, 0.32) 0%, rgba(80, 140, 220, 0.12) 45%, transparent 70%);
}
.ar-hero.league-bronze .ar-hero-glow {
  background: radial-gradient(circle, rgba(220, 150, 80, 0.32) 0%, rgba(120, 80, 40, 0.1) 45%, transparent 70%);
}
.ar-hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, transparent 0%, rgba(7, 20, 38, 0.25) 55%, rgba(7, 20, 38, 0.72) 100%),
    linear-gradient(180deg, rgba(7, 20, 38, 0.1) 0%, transparent 30%, rgba(7, 20, 38, 0.85) 100%);
  pointer-events: none;
}
.ar-hero-fg {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px 16px;
}
.ar-emblem-wrap {
  position: relative;
  width: clamp(108px, 28vw, 140px);
  height: clamp(108px, 28vw, 140px);
  display: grid;
  place-items: center;
}
.ar-emblem-wrap::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 120, 0.45) 0%, transparent 68%);
  filter: blur(8px);
  z-index: 0;
}
.ar-emblem {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 16px rgba(255, 200, 80, 0.35));
}
.ar-league-box {
  width: min(86%, 300px);
  padding: 10px 16px 12px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(12, 28, 52, 0.92), rgba(8, 18, 36, 0.95));
  border: 1.5px solid rgba(120, 170, 230, 0.35);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}
.ar-league-box strong {
  display: block;
  font-size: clamp(17px, 4.6vw, 20px);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.ar-pts {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  color: #fff;
}
.ar-pts svg { width: 16px; height: 16px; }
.ar-pts b {
  font-size: 14px;
  font-weight: 900;
}
.ar-prog {
  position: relative;
  margin-top: 10px;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(4, 12, 28, 0.85);
  border: 1px solid rgba(100, 160, 230, 0.35);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
.ar-prog i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e5bb8 0%, #3d9dff 55%, #7ec8ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ar-prog em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.02em;
}

.ar-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px;
  background: #0a1628;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ar-tab {
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 10px;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 900;
  color: rgba(247, 241, 228, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ar-tab.on {
  color: #3a2608;
  background: linear-gradient(180deg, #ffe56a, #f0a000);
  border-color: rgba(255, 220, 120, 0.5);
  box-shadow: 0 2px 0 #c47d08;
}
.ar-tab:active:not(.on) { background: rgba(255, 255, 255, 0.08); }

.ar-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ar-tools {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 6px 12px 0;
  min-height: 36px;
}
.ar-tools.is-hidden {
  visibility: hidden;
  pointer-events: none;
}
.ar-refresh {
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
  color: #9fd0ff;
  background: rgba(80, 140, 220, 0.15);
  border: 1px solid rgba(120, 180, 255, 0.3);
}

.ar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 8px;
}

.ar-rival {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 42%),
    linear-gradient(180deg, #173049, #0d1a2c);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}
.ar-rival.league-gold { border-color: rgba(246, 196, 69, 0.35); }
.ar-rival.league-silver { border-color: rgba(180, 200, 220, 0.28); }
.ar-rival.league-bronze { border-color: rgba(200, 140, 80, 0.3); }

.ar-av {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(246, 196, 69, 0.55);
  background: #1a3a6a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.ar-av-img,
.ar-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ar-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ar-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ar-info strong {
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 7px 0 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ar-chip.league-gold {
  border-color: rgba(246, 196, 69, 0.45);
  background: rgba(246, 196, 69, 0.12);
}
.ar-chip.league-silver {
  border-color: rgba(180, 200, 220, 0.4);
  background: rgba(160, 180, 200, 0.12);
}
.ar-chip.league-bronze {
  border-color: rgba(200, 140, 80, 0.4);
  background: rgba(180, 120, 60, 0.14);
}
.ar-chip-ico,
.ar-chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.ar-chip i {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: rgba(247, 241, 228, 0.9);
}
.ar-lv {
  font-size: 11px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.55);
}
.ar-pow {
  font-size: 12px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.72);
}
.ar-pow b { color: #9fe870; font-weight: 900; }

.ar-fight {
  min-width: 82px;
  height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #3a2608;
  background: linear-gradient(180deg, #ffe56a, #f0a000);
  border: 1px solid rgba(255, 220, 120, 0.55);
  box-shadow: 0 3px 0 #c47d08, 0 6px 12px rgba(0, 0, 0, 0.25);
}
.ar-fight-ico,
.ar-fight img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.ar-fight:active { transform: translateY(1px); }

.ar-league-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #0d1a2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ar-league-row.on {
  border-color: rgba(246, 196, 69, 0.5);
  background: linear-gradient(180deg, #1a2c18, #0d1a2c);
}
.ar-league-ico,
.ar-league-row img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.ar-league-row strong { display: block; font-size: 14px; font-weight: 900; }
.ar-league-row span { font-size: 11px; font-weight: 800; color: rgba(247, 241, 228, 0.6); }
.ar-league-row em {
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  color: #ffe56a;
}

.ar-board-row {
  display: grid;
  grid-template-columns: 34px 44px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #15263c, #0d1a2c);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ar-board-row.is-me {
  border-color: rgba(246, 196, 69, 0.5);
  background: linear-gradient(180deg, rgba(246, 196, 69, 0.14), #0d1a2c);
}
.ar-board-row b {
  text-align: center;
  color: #f6c445;
  font-size: 13px;
  font-weight: 900;
}
.ar-board-av {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(246, 196, 69, 0.45);
  background: #1a3a6a;
}
.ar-board-av-img,
.ar-board-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ar-board-info { min-width: 0; }
.ar-board-info strong {
  display: block;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-board-info em {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.55);
}
.ar-board-row span {
  font-size: 13px;
  font-weight: 900;
  color: #9fe870;
}

.ar-rew {
  margin-bottom: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #0d1a2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ar-rew.is-you {
  border-color: rgba(246, 196, 69, 0.55);
  box-shadow: inset 0 0 0 1px rgba(246, 196, 69, 0.2);
}
.ar-rew strong { display: block; font-size: 14px; font-weight: 900; color: #ffe56a; }
.ar-rew span { font-size: 12px; font-weight: 800; color: rgba(247, 241, 228, 0.7); }
.ar-rew-note {
  margin: 10px 4px 0;
  font-size: 12px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.55);
  line-height: 1.35;
}
.ar-daily-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 48, 72, 0.9), rgba(12, 22, 38, 0.95));
  border: 1px solid rgba(122, 215, 255, 0.28);
}
.ar-daily-box p {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  color: rgba(247, 241, 228, 0.72);
}
.ar-claim {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  color: #1a1208;
  background: linear-gradient(180deg, #ffe56a, #f0a000);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.ar-claim.is-done {
  color: rgba(247, 241, 228, 0.55);
  background: #1a2740;
  box-shadow: none;
}

.ar-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #0a1628;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
}
.ar-foot b { color: #fff; font-weight: 900; }
.ar-refill {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #103018;
  background: linear-gradient(180deg, #7dff9a, #3ddc6e);
  border: 1px solid rgba(180, 255, 200, 0.45);
  box-shadow: 0 3px 0 #1a7a48;
}
.ar-refill svg { width: 20px; height: 20px; }
.ar-refill:active { transform: translateY(1px); }

@media (max-height: 640px) {
  .ar-hero { height: 180px; }
  .ar-emblem-wrap { width: 88px; height: 88px; }
  .ar-league-box strong { font-size: 15px; }
}
