/* ===== MODAL SHELL ===== */
.chall-modal{
  background: linear-gradient(#2e3448e0, #232a3fe0);
  border: 1px solid #000;
  box-shadow: 0 0 25px rgba(0,0,0,.6);
  border-radius: 10px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 0 20px #ff8c00;
}

.chall-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  /*background: linear-gradient(#313a55, #262d44);*/
  border-bottom: 1px solid rgba(0,0,0,.6);
}

.chall-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-family: 'Aldrich', sans-serif;
  font-size: 22px;
  color:#ffeca2;
  text-shadow: 0 2px 2px #000;
}

.chall-title-icon{
  width: 32px;
  height: 32px;
}

.chall-close{
  color:#fff;
  opacity: .9;
  text-shadow: none;
  font-size: 28px;
  line-height: 28px;
  margin: 0;
}

/* ===== TABS ===== */
.chall-tabs-wrap{
  padding: 10px 12px 0;
}

.chall-tabs{
  display:flex;
  gap:10px;
  border-bottom: none !important;
}

.chall-tabs > li{
  width: 50%;
  text-align:center;
}

.chall-tabs > li > a{
  border: 1px solid rgba(0,0,0,.55) !important;
  border-bottom: none !important;
  border-radius: 10px 10px 0 0 !important;
  background: rgba(31,36,53,.85) !important;
  color:#fff !important;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 8px !important;
  font-family: 'Aldrich', sans-serif;
  text-shadow: 0 2px 2px #000;
}

.chall-tabs > li.active > a{
  background: linear-gradient(#3a4567, #2b3350) !important;
  border-color: rgba(255,212,0,.35) !important;
  box-shadow: 0 0 12px rgba(255,212,0,.15);
}

.tab-ico{
  width: 22px;
  height: 22px;
}
.tab-ico-chest{
  width: 26px;
  height: 26px;
}

.chall-tab-content{
  padding: 12px;
}

/* ===== STATS TAB LAYOUT ===== */
.challenge-layout{
  display:flex;
  flex-direction:column;
  gap: 5px;
}

/* HERO */
.challenge-hero{
  display:flex;
  gap: 14px;
  align-items:center;
  background: linear-gradient(#2f3751c7, #242b40db);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 10px;
  padding: 5px 4px 4px 4px;
  box-shadow: inset 0 0 10px rgba(0,0,0,.55);
}

.challenge-hero-icon{
  width: 78px;
  height: 78px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,0,0,.6);
}

.challenge-hero-info{
  flex:1;
  min-width: 0;
}

.challenge-level-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.challenge-level-text{
  font-family:'Aldrich', sans-serif;
  font-size: 20px;
  color:#ffeca2;
  text-shadow: 0 2px 2px #000;
  white-space: nowrap;
}

.challenge-mini-inv{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.mini-pill{
  display:flex;
  align-items:center;
  gap:6px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.55);
  padding: 6px 8px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: inset 0 0 8px rgba(0,0,0,.3);
  min-width:100px;
}

.mini-pill img{
  width: 32px;
  height: 32px;
}

.challenge-progress-wrap{
  margin-top: 5px;
}

.challenge-progress-bar{
  width:100%;
  height: 22px;
  background: #161a27;
  border-radius: 8px;
  overflow:hidden;
  border: 1px solid rgba(0,0,0,.8);
}

.challenge-progress-fill{
  height:100%;
  background: linear-gradient(to right, #8bc34a, #cddc39);
  box-shadow: 0 0 15px rgba(205,220,57,.25);
  transition: width .35s ease;
}

.challenge-progress-meta{
  margin-top: 8px;
  opacity: .9;
  font-size: 13px;
}

/* MAIN GRID */
.challenge-main{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}

.challenge-card{
  background: rgba(43,50,71,.75);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 12px rgba(0,0,0,.45);
}

.card-head{
  /*display:flex;
  align-items:baseline;*/
  justify-content:space-between;
  gap: 10px;
}

.card-head h4{
  margin:0;
  font-family:'Aldrich', sans-serif;
  color:#ffeca2;
  text-shadow: 0 2px 2px #000;
}

.card-sub{
  font-size: 14px;
  opacity: .75;
}

.card-head.centered{
  justify-content:center;
  flex-direction:column;
}

/* inventory */
.challenge-inventory-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.inv-card{
  display:flex;
  align-items:center;
  gap: 10px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 10px;
  padding: 10px;
}

.inv-ico{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.55);
  background: linear-gradient(rgb(227 207 85) 50%, rgb(214 164 73) 50%);
  box-shadow: rgb(199 227 44) 0 0 6px 0;
}

.inv-meta{ flex:1; }
.inv-label{ font-size: 12px; opacity:.75; }
.inv-value{
  font-family:'Aldrich', sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* highlight card */
.highlight-card{
  border: 1px solid rgba(255,212,0,.55);
  box-shadow: 0 0 18px rgba(255,212,0,.10), inset 0 0 12px rgba(0,0,0,.45);
}

.today-rewards{
  display:flex;
  justify-content:space-around;
  gap: 10px;
  margin-top: 8px;
}

.reward{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 4px;
  min-width: 70px;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 10px;
  padding: 10px 8px;
}

.reward img{ width: 34px; height: 34px; }

.reward span{
  font-family:'Aldrich', sans-serif;
  font-size: 16px;
  color:#1bff00;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.reward-footnote{
  text-align:center;
  margin-top: 8px;
  font-size: 12px;
  opacity: .85;
}

.divider-soft{
  height:1px;
  background: rgba(255,255,255,.08);
  margin: 5px 0;
}

/* mystery key exchange */
.mystery-key-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  background: linear-gradient(#1f2435, #181c2a);
  border: 1px solid rgba(0,0,0,.6);
  border-radius: 10px;
  padding: 10px;
}

.mkey-left{
  display:flex;
  flex-direction:column;
  gap: 2px;
}

.mkey-mascot img{ width: 44px; height: 44px; }

.mkey-title{
  font-family: 'Aldrich', sans-serif;
  font-size: 14px;
  color: #ffeca2;
  text-shadow: 0 2px 2px #000;
}

.mkey-sub{
  font-size: 12px;
  opacity: .75;
}

.mkey-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap: 8px;
}

.mkey-cost{
  display:flex;
  align-items:center;
  gap: 6px;
  font-weight: 800;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.6);
  padding: 6px 10px;
  border-radius: 999px;
}

.mkey-cost img{ width: 18px; height: 18px; }

.btn-mkey, #buy-mystery-key{
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid #333;
  color:#fff;
  font-family:'Aldrich', sans-serif;
  text-shadow: 0 2px 2px #000;
  background: linear-gradient(0deg, rgb(50 50 50) 0%, rgb(84 84 84) 100%);
  width: 170px;
}

.btn-mkey:hover, #buy-mystery-key:hover{
  background: linear-gradient(0deg, rgb(46 46 46) 0%, rgb(62 63 68) 100%);
}

.mkey-note{
  text-align:center;
  margin-top: 8px;
  font-size: 12px;
  opacity: .85;
}

/* milestones */
.challenge-milestones{
  background: rgba(43,50,71,.65);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 12px rgba(0,0,0,.45);
}

.milestone-row{
  display:flex;
  justify-content:center;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 10px;
}

.milestone{
  width: 65px;
  border-radius: 10px;
  padding: 10px 8px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(0,0,0,.6);
  box-shadow: inset 0 0 10px rgba(0,0,0,.35);
  text-align:center;
}
#challenge-rewards {
   background: rgba(43, 50, 71, .75);
}
.milestone-top{
  font-family:'Aldrich', sans-serif;
  font-size: 18px;
  color:#cddc39;
  text-shadow: 0 2px 2px #000;
}

.milestone-bot{
  margin-top: 2px;
  font-size: 12px;
  opacity: .85;
}

/* stats strip */
.challenge-stats-strip{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:space-between;
}

.stat-pill{
  flex: 1;
  min-width: 180px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 10px;
  padding: 5px;
  text-align:center;
  box-shadow: inset 0 0 10px rgba(0,0,0,.35);
}

.stat-label{
  font-size: 12px;
  opacity:.75;
}

.stat-value{
  margin-top: 1px;
  font-family:'Aldrich', sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 2px 2px #000;
}

/* ===== MYSTERY TAB ===== */
.mystery-layout{
  padding: 20px 10px;
  display:flex;
  justify-content:center;
}

.mystery-card{
  width: 100%;
  max-width: 520px;
  background: rgba(43,50,71,.75);
  /*border: 1px solid rgba(0,0,0,.6);*/
  border-radius: 10px;
  padding: 18px;
  text-align:center;
  /*box-shadow: inset 0 0 12px rgba(0,0,0,.45);*/
}

.mystery-title{
  font-family:'Aldrich', sans-serif;
  font-size: 22px;
  color:#ffeca2;
  text-shadow: 0 2px 2px #000;
}

.mystery-sub{
  margin-top: 3px;
  opacity: .8;
}


.btn-mystery{
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,.6);
  background: linear-gradient(#2e7cff, #165bd8);
  color:#fff;
  font-family:'Aldrich', sans-serif;
  text-shadow: 0 2px 2px #000;
}

.btn-mystery:hover{
  background: linear-gradient(#2a73f0, #1452c1);
}

.mystery-note{
  margin-top: 10px;
  font-size: 12px;
  opacity: .8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px){
  .challenge-main{ grid-template-columns: 1fr; }
  .challenge-level-row{ flex-direction:column; align-items:flex-start; }
  .challenge-mini-inv{ justify-content:flex-start; }
  .btn-mkey, #buy-mystery-key{ width: 100%; }
}






.chall-inv {
    background: linear-gradient(rgb(227 207 85) 50%, rgb(214 164 73) 50%);
    box-shadow: rgb(199 227 44) 0px 0px 5px 0px;
    margin: 0px -5px;
    /*padding: 15px;*/
    text-align: center;
    border: 2px solid #474b56;
    font-size: 15px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    align-content: center;
    /*margin-right:5px;*/
}

.chall-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #2e3138;
  text-align: center;
  border: 2px solid #474b56;
  border-radius: 4px;
  padding-top: 10px;
  padding-bottom: 0;
  font-size:20px;
  font-weight: bold;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  font-family:'Aldrich', sans-serif;
  /* background: linear-gradient(to bottom, #5592e3 50%, #4985d6 50%);*/

  width: 100%;
  border: 2px solid #262626;
  background: linear-gradient(#222328 50%, #2e3138 50%);
  border-radius: 5px;
  box-shadow: #ffd318 0px 0px 5px 0px inset;
}

.chall-c-rewards {
  display: flex;
  flex-direction: unset;
  align-items: center;
  text-align: center;
  border-radius: 4px;
  padding-top: 10px;
  padding-bottom: 0;
  font-size:14px;
  font-weight: bold;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  font-family:'Aldrich', sans-serif;
  width: 25%;
  max-width: 85px;
  /* background: linear-gradient(to bottom, #5592e3 50%, #4985d6 50%);*/
  /*background: linear-gradient(to bottom, #9955e3 50%, #5f49d6 50%);*/
  /*border: 2px solid #474b56;*/
  /*border-radius: 100px;*/
  /*box-shadow: #1070ff 0px 0px 5px 0px inset;*/
}

.chall-mythic {
  width: 100%;
  border-top: 2px solid #262626;
  background: linear-gradient(#222328 50%, #2e3138 50%);
  border-radius: 5px;
  box-shadow: #ffd318 0px 0px 5px 0px inset;
}

.chall-numb-box {
    background: linear-gradient(#22232859 50%, #2e313885 50%);
    border-radius: 5px;
    font-size: 20px;
    margin-top: -20px;
    margin-top: 25px;
    color: #1bff00;
    position: absolute;
    margin-left: 27px;
}
.chall-inv-holder {
  text-align:left;display: flex;align-items: center;width: 75%;margin: 0 auto;
}
  #buy-mystery-key {
    float: left;padding: 5px;border: 2px solid #000;background-color: #2e3138;width: 100%;height: 40px;background: linear-gradient(0deg, rgb(50 50 50) 0%, rgb(84 84 84) 100%);border: 4px solid #333;
  }
  #buy-mystery-key:hover {
    background: linear-gradient(0deg, rgb(46 46 46) 0%, rgb(62 63 68) 100%);
  }












/* ===== Mystery Box: Live Opening ===== */
.mystery-live { position: relative; overflow: hidden; }

.mystery-stage{
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 280px;
  margin: 10px auto 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(0,0,0,.55);
  box-shadow: inset 0 0 18px rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
}

/* subtle glow behind chest */
.mystery-glow{
  position:absolute;
  inset: -40px;
  background:
    radial-gradient(40% 35% at 50% 55%, rgba(255,212,0,.22), transparent 60%),
    radial-gradient(35% 30% at 50% 60%, rgba(46,124,255,.16), transparent 60%),
    radial-gradient(60% 45% at 50% 55%, rgba(186,104,200,.12), transparent 70%);
  filter: blur(2px);
  opacity: 0.9;
  pointer-events:none;
  transition: opacity .3s ease;
}

.mystery-chest{
  width: 440px;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
  will-change: transform, filter;
}

/* particles container */
.mystery-particles{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}

/* reward popout */
.mystery-reward{
  position:absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%) translateY(18px) scale(.92);
  opacity: 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 8px;
  text-align:center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgb(0 0 0 / 57%);
  border: 1px solid rgba(255,212,0,.35);
  box-shadow: 0 0 18px rgba(255,212,0,.12), inset 0 0 16px rgba(0,0,0,.35);
  max-width: 90%;
}

.mystery-reward img{
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  /*border: 2px solid rgba(255,212,0,.35);*/
  box-shadow: 0 0 18px rgba(255,212,0,.18);
}

.mystery-reward-text{
  font-family:'Aldrich', sans-serif;
  font-size: 22px;
  color: #ffeca2;
  text-shadow: 0 2px 2px #000;
}

.mystery-reward-sub{
  font-size: 12px;
  opacity: .85;
}

/* button states */
.btn-mystery.is-busy{
  opacity: .85;
  pointer-events:none;
  filter: saturate(.8);
}
.btn-mystery.is-busy::after{
  content:"";
  display:inline-block;
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: rgba(255,255,255,.95);
  animation: spin .8s linear infinite;
  vertical-align: middle;
}

/* ===== Animations ===== */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes chestShakeSoft {
  0%   { transform: translateX(0) rotate(0) scale(1); }
  10%  { transform: translateX(-2px) rotate(-1deg) scale(1.005); }
  20%  { transform: translateX(2px) rotate(1deg) scale(1.01); }
  30%  { transform: translateX(-3px) rotate(-2deg) scale(1.015); }
  40%  { transform: translateX(3px) rotate(2deg) scale(1.02); }
  50%  { transform: translateX(-4px) rotate(-3deg) scale(1.025); }
  60%  { transform: translateX(4px) rotate(3deg) scale(1.03); }
  70%  { transform: translateX(-3px) rotate(-2deg) scale(1.025); }
  80%  { transform: translateX(3px) rotate(2deg) scale(1.02); }
  90%  { transform: translateX(-2px) rotate(-1deg) scale(1.01); }
  100% { transform: translateX(0) rotate(0) scale(1); }
}

@keyframes chestOpenPop {
  0%   { transform: translateY(0) scale(1); filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); }
  55%  { transform: translateY(-8px) scale(1.06); filter: drop-shadow(0 18px 24px rgba(0,0,0,.6)); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes rewardRise {
  0%   { opacity: 0; transform: translateX(-50%) translateY(18px) scale(.92); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(-30px) scale(1.04); }
  100% { opacity: 1; transform: translateX(-50%) translateY(-22px) scale(1); }
}

@keyframes glowPulse {
  0%,100% { opacity: .75; }
  50%     { opacity: 1; }
}

/* classes toggled by JS */
.mystery-stage.is-opening .mystery-glow{
  animation: glowPulse .9s ease-in-out infinite;
}

.mystery-stage.is-opening #mysteryChest{
  animation: chestShakeSoft 1.0s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255,212,0,.25)) drop-shadow(0 12px 18px rgba(0,0,0,.55));
}

.mystery-stage.is-reveal #mysteryChest{
  animation: chestOpenPop .55s ease-out 1;
}

.mystery-stage.is-reward #mysteryReward{
  animation: rewardRise .8s cubic-bezier(.2,.9,.2,1) forwards;
}

/* Particle dot */
.mystery-dot{
  position:absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  box-shadow: 0 0 10px rgba(255,212,0,.25);
  opacity: 0;
  transform: translateY(0) scale(1);
  animation: dotBurst 900ms ease-out forwards;
}

@keyframes dotBurst{
  0% { opacity: 0; transform: translateY(0) scale(.8); }
  15%{ opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.1); }
}

@media (max-width: 520px){
  .mystery-stage{ height: 250px; }
  .mystery-chest{ width: 210px; }
  .mystery-reward-text{ font-size: 20px; }
}
