/* QuestCards — style arcade / dynamique */
:root{
  --bg:#0b0f17;
  --panel:#101826;
  --card:#0f1726;
  --stroke:#24324a;
  --text:#e7efff;
  --muted:#9bb0d3;
  --accent:#6cf0ff;
  --accent2:#9b6cff;
  --danger:#ff4d6d;
  --good:#50fa7b;

  --common:#c7d2fe;
  --rare:#38bdf8;
  --epic:#a78bfa;
  --legendary:#fbbf24;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 20% 0%, rgba(108,240,255,.08), transparent 60%),
              radial-gradient(900px 500px at 85% 15%, rgba(155,108,255,.08), transparent 60%),
              var(--bg);
  color:var(--text);
}

code{color:#cfe7ff}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(16,24,38,.8), rgba(16,24,38,.35));
  backdrop-filter: blur(10px);
  position:sticky;
  top:0;
  z-index:20;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(108,240,255,.9), rgba(155,108,255,.9));
  color:#071018;
  font-weight:900;
  box-shadow: var(--shadow);
}
.brand-text .title{font-weight:900; letter-spacing:.2px}
.brand-text .subtitle{font-size:12px; color:var(--muted); margin-top:2px}

.hud{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.hud-card{
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background: rgba(15,23,38,.7);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  min-width:110px;
}
.hud-label{font-size:11px;color:var(--muted)}
.hud-value{font-size:18px;font-weight:900;margin-top:2px}

.tabs{
  display:flex; gap:8px;
  padding:10px 16px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.tab{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(15,23,38,.55);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:700;
  transition: transform .08s ease, border-color .2s ease;
}
.tab:hover{transform: translateY(-1px); border-color: rgba(108,240,255,.35)}
.tab.active{
  background: linear-gradient(135deg, rgba(108,240,255,.18), rgba(155,108,255,.18));
  border-color: rgba(108,240,255,.45);
}

.container{padding:16px; max-width:1200px; margin:0 auto}
.panel{padding:0 0 22px}
.hidden{display:none !important}

.panel-header{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin:8px 0 14px;
}
.panel-header h2{margin:0; font-size:22px}
.panel-actions{display:flex; gap:10px; flex-wrap:wrap}

.btn{
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(135deg, rgba(108,240,255,.16), rgba(155,108,255,.16));
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.2px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover{transform: translateY(-1px); filter: brightness(1.08)}
.btn:active{transform: translateY(0px) scale(.99)}
.btn-ghost{background: rgba(15,23,38,.45); box-shadow:none}
.btn-danger{background: rgba(255,77,109,.18); border-color: rgba(255,77,109,.35)}
.danger{border-color: rgba(255,77,109,.25) !important}

.columns{display:grid; grid-template-columns: 1.2fr .8fr; gap:14px}
@media (max-width: 980px){ .columns{grid-template-columns:1fr} }

.card{
  background: rgba(15,23,38,.65);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:14px;
  box-shadow: var(--shadow);
}
.card h3{margin:0 0 10px}
.card h4{margin:12px 0 8px}
.card-inner{
  margin-top:12px;
  padding-top:12px;
  border-top:1px dashed rgba(255,255,255,.12);
}
.muted{color:var(--muted); font-size:14px}
.note{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(108,240,255,.18);
  border-radius:14px;
  background: rgba(108,240,255,.06);
  color:#d7f8ff;
  font-size:14px;
}

.info-row{display:flex; gap:10px; flex-wrap:wrap; margin:8px 0 12px}
.chip{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(15,23,38,.55);
}

.filters{display:grid; grid-template-columns: 1fr 1fr 1.4fr; gap:10px; margin-bottom:12px}
@media (max-width: 700px){ .filters{grid-template-columns:1fr} }

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px}
@media (max-width: 700px){ .grid2{grid-template-columns:1fr} }

.field{display:grid; gap:6px; font-size:13px}
.field span{color:var(--muted)}
.field input, .field select{
  background: rgba(7,10,16,.55);
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  outline:none;
}
.field input:focus, .field select:focus{border-color: rgba(108,240,255,.45)}

.task-list{display:grid; gap:8px}
.task{
  display:grid;
  grid-template-columns: 26px 1fr auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background: rgba(16,24,38,.45);
}
.task.done{opacity:.78; border-color: rgba(80,250,123,.25)}
.checkbox{
  width:20px;height:20px;border-radius:6px;
  border:2px solid rgba(255,255,255,.22);
  display:grid; place-items:center;
}
.task.done .checkbox{border-color: rgba(80,250,123,.55)}
.checkmark{font-weight:900; color: var(--good); font-size:14px; display:none}
.task.done .checkmark{display:block}
.task-title{font-weight:800}
.task-meta{color:var(--muted); font-size:12px; margin-top:2px}
.task-actions{display:flex; gap:8px; align-items:center}
.points-pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(108,240,255,.22);
  background: rgba(108,240,255,.08);
  font-weight:900;
}
.kebab{
  border:none; background: transparent; color:var(--text);
  cursor:pointer; font-size:18px; padding:4px 8px; border-radius:10px;
}
.kebab:hover{background: rgba(255,255,255,.06)}
.menu{
  position:relative;
}
.menu-panel{
  position:absolute;
  right:0; top:30px;
  background: rgba(7,10,16,.96);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:6px;
  min-width:170px;
  box-shadow: var(--shadow);
  z-index:10;
}
.menu-panel button{
  width:100%;
  text-align:left;
  padding:10px 10px;
  border-radius:12px;
  background: transparent;
  border:none;
  color:var(--text);
  cursor:pointer;
  font-weight:700;
}
.menu-panel button:hover{background: rgba(255,255,255,.08)}
.menu-panel .danger-item{color: #ffd0d8}

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform: translateX(-50%);
  background: rgba(7,10,16,.95);
  border:1px solid rgba(255,255,255,.10);
  padding:10px 14px;
  border-radius:14px;
  box-shadow: var(--shadow);
  color:var(--text);
  font-weight:800;
  z-index:60;
  display:none;
}

.boss{
  padding:12px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background: linear-gradient(135deg, rgba(255,77,109,.10), rgba(155,108,255,.10));
}
.boss-title{font-weight:900}
.boss-desc{color:var(--muted); margin:6px 0 10px; font-size:14px}

.rarity{display:grid; gap:8px}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%; margin-right:8px}
.dot.common{background: var(--common)}
.dot.rare{background: var(--rare)}
.dot.epic{background: var(--epic)}
.dot.legendary{background: var(--legendary)}

.booster-area{display:grid; grid-template-columns: 200px 1fr; gap:14px; align-items:start}
@media (max-width: 800px){ .booster-area{grid-template-columns:1fr} }

.pack{
  position:relative;
  width:200px;
  border-radius:20px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
}
.pack img{display:block;width:100%;height:auto}
.pack-glow{
  position:absolute; inset:-20%;
  background: radial-gradient(circle at 30% 20%, rgba(108,240,255,.35), transparent 45%),
              radial-gradient(circle at 70% 80%, rgba(155,108,255,.35), transparent 45%);
  filter: blur(6px);
  opacity:.85;
  pointer-events:none;
  mix-blend-mode: screen;
  animation: floatGlow 2.3s ease-in-out infinite alternate;
}
@keyframes floatGlow{from{transform: translateY(0)}to{transform: translateY(6px)}}

.reveal{
  position:relative;
  width:100%;
  min-height: 520px;
  display:grid;
  place-items:center;
  padding:10px;
}

.cardflip{
  position:relative;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(7,10,16,.55);
  box-shadow: var(--shadow);
}
.cardflip img{display:block;width:100%;height:auto}
.badge{
  position:absolute;
  left:10px; top:10px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  background: rgba(7,10,16,.75);
  border:1px solid rgba(255,255,255,.12);
}
.badge.common{border-color: rgba(199,210,254,.35)}
.badge.rare{border-color: rgba(56,189,248,.35)}
.badge.epic{border-color: rgba(167,139,250,.35)}
.badge.legendary{border-color: rgba(251,191,36,.45)}

.collection-controls{
  display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin-bottom:12px
}

.collection-grid{
  display:grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap:10px;
}
@media (max-width: 1100px){ .collection-grid{grid-template-columns: repeat(6, minmax(120px, 1fr));} }
@media (max-width: 820px){ .collection-grid{grid-template-columns: repeat(4, minmax(120px, 1fr));} }
@media (max-width: 520px){ .collection-grid{grid-template-columns: repeat(2, minmax(120px, 1fr));} }

.slot{
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(16,24,38,.45);
  cursor:pointer;
  transition: transform .08s ease, border-color .2s ease;
  position:relative;
}
.slot:hover{transform: translateY(-1px); border-color: rgba(108,240,255,.35)}
.slot img{display:block;width:100%;height:auto; opacity:.95}
.slot .slot-top{
  position:absolute; inset:0 0 auto 0;
  padding:8px 10px;
  display:flex; justify-content:space-between; align-items:center;
  background: linear-gradient(180deg, rgba(7,10,16,.82), transparent);
}
.slot .slot-code{font-weight:900}
.slot .slot-rarity{
  width:10px;height:10px;border-radius:50%;
}
.slot .slot-rarity.common{background: var(--common)}
.slot .slot-rarity.rare{background: var(--rare)}
.slot .slot-rarity.epic{background: var(--epic)}
.slot .slot-rarity.legendary{background: var(--legendary)}
.locked::after{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(600px 300px at 20% 0%, rgba(108,240,255,.08), transparent 60%),
              rgba(7,10,16,.55);
}
.locked .slot-top{background: rgba(7,10,16,.70)}
.locked .slot-code{color: rgba(255,255,255,.75)}

.modal{position:fixed; inset:0; z-index:80}
.modal-backdrop{position:absolute; inset:0; background: rgba(0,0,0,.65)}
.modal-card{
  position:absolute; left:50%; top:50%;
  transform: translate(-50%,-50%);
  width:min(860px, 92vw);
  border-radius:18px;
  background: rgba(7,10,16,.96);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-close{
  position:absolute; right:10px; top:10px;
  border:none; background: rgba(255,255,255,.08);
  color:var(--text);
  width:34px;height:34px;border-radius:12px;
  cursor:pointer;
}
.modal-body{display:flex; gap:14px; padding:14px}
.modal-body img{width:320px; border-radius:16px; border:1px solid rgba(255,255,255,.10)}
@media (max-width: 760px){
  .modal-body{flex-direction:column}
  .modal-body img{width:100%}
}
.modal-info{display:flex; flex-direction:column; gap:8px}
.modal-title{font-size:20px; font-weight:900}
.modal-meta{color:var(--muted)}
.modal-actions{margin-top:8px; display:flex; gap:10px; flex-wrap:wrap}

.craft{margin-top:10px; display:flex; gap:10px; align-items:end; flex-wrap:wrap}


/* Booster stack reveal */
.stack-card{
  position:absolute;
  width:min(360px, 92%);
  max-width:360px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(7,10,16,.55);
  box-shadow: var(--shadow);
  cursor:pointer;
  user-select:none;
  transform: translateY(var(--stack-offset, 0px)) scale(var(--stack-scale, 1));
  transition: transform .18s ease, opacity .18s ease;
}
.stack-card.hidden{
  opacity:0;
  pointer-events:none;
  transform: translateY(16px) scale(.98);
}
.stack-card img{display:block;width:100%;height:auto}
.stack-hint{
  position:absolute;
  bottom:12px;
  left:50%;
  transform: translateX(-50%);
  background: rgba(7,10,16,.75);
  border:1px solid rgba(255,255,255,.10);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  color: var(--text);
}

/* WOW effects (rare+) */
.wow::before{
  content:"";
  position:absolute;
  inset:-20%;
  pointer-events:none;
  opacity:0;
}
.wow.rare::before{
  background:
    radial-gradient(circle at 20% 30%, rgba(56,189,248,.45), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(56,189,248,.35), transparent 45%),
    radial-gradient(circle at 40% 80%, rgba(108,240,255,.25), transparent 50%);
}
.wow.epic::before{
  background:
    radial-gradient(circle at 25% 35%, rgba(167,139,250,.55), transparent 42%),
    radial-gradient(circle at 78% 72%, rgba(155,108,255,.45), transparent 48%),
    radial-gradient(circle at 50% 15%, rgba(108,240,255,.25), transparent 55%);
}
.wow.legendary::before{
  background:
    radial-gradient(circle at 22% 32%, rgba(251,191,36,.65), transparent 40%),
    radial-gradient(circle at 78% 72%, rgba(255,77,109,.35), transparent 48%),
    radial-gradient(circle at 50% 12%, rgba(251,191,36,.28), transparent 55%);
}
.wow-active::before{
  animation: sparkle 850ms ease-out 1;
  opacity:1;
}
@keyframes sparkle{
  0%{transform: translateY(10px) scale(.98); opacity:0;}
  30%{opacity:1;}
  100%{transform: translateY(-6px) scale(1.02); opacity:0;}
}

/* small glitter dots */
.wow::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  background:
    radial-gradient(circle, rgba(255,255,255,.9) 0 2px, transparent 3px) 20px 30px/120px 120px,
    radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 2px) 80px 10px/140px 140px,
    radial-gradient(circle, rgba(255,255,255,.8) 0 2px, transparent 3px) 40px 90px/160px 160px;
  mix-blend-mode: screen;
}
.wow-active::after{
  animation: glitter 900ms ease-out 1;
  opacity:.9;
}
@keyframes glitter{
  0%{transform: translateY(10px); opacity:0;}
  25%{opacity:.95;}
  100%{transform: translateY(-12px); opacity:0;}
}
