/* quest-widget.css */

.qw { position: fixed; bottom: 16px; left: 16px; z-index: 900; }

/* ── Pastille (mobile only) ── */
.qw-pill { display: none; }

/* ── Card (desktop) ── */
.qw-card { width: 340px; background: rgba(16, 14, 38, .96); border: 1px solid rgba(145, 70, 255, .15); border-radius: 14px; overflow: hidden; transition: border-color .3s; }

/* Pulsing claimable */
.qw--claimable .qw-card { border-color: rgba(244, 201, 66, .4); animation: qw-pulse 2.5s ease-in-out infinite; }
.qw--claimable .qw-pill { border-color: rgba(244, 201, 66, .5); animation: qw-pulse 2.5s ease-in-out infinite; }
@keyframes qw-pulse { 0%,100%{border-color:rgba(244,201,66,.2)} 50%{border-color:rgba(244,201,66,.55)} }

/* Header */
.qw-hd { display: flex; align-items: center; padding: 12px 16px 0; cursor: pointer; user-select: none; }
.qw-t { font-family: 'Antonio','Segoe UI',sans-serif; font-size: 14px; font-weight: 700; color: #fff; flex: 1; letter-spacing: .3px; }
.qw-hd-badge { width: 20px; height: 20px; border-radius: 50%; background: #f4c942; color: #12122b; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-right: 8px; animation: qw-pop .5s ease; }
@keyframes qw-pop { 0%{transform:scale(0)} 60%{transform:scale(1.2)} 100%{transform:scale(1)} }
.qw-tm { font-size: 11px; color: rgba(244,201,66,.7); font-variant-numeric: tabular-nums; margin-right: 6px; }
.qw-chev { color: #666; transition: transform .25s; flex-shrink: 0; }
.qw-chev.qw-chev--flip { transform: rotate(180deg); }

/* Summary */
.qw-summary { display: flex; gap: 8px; padding: 8px 16px 12px; cursor: pointer; }
.qw-sum-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.04);
  transition: border-color .2s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.qw-sum-item--claim { border-color: rgba(244,201,66,.3); background: rgba(244,201,66,.04); }
.qw-sum-item--done { border-color: rgba(34,197,94,.2); }
.qw-sum-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 9px; font-weight: 700; }
.qw-sum-icon.ok { background: rgba(34,197,94,.15); color: #22c55e; }
.qw-sum-icon.wip { background: rgba(245,158,11,.15); color: #f59e0b; }
.qw-sum-icon.claim { background: rgba(244,201,66,.2); color: #f4c942; }
.qw-sum-txt {
  font-size: 10px;
  color: #aaa;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.qw-sum-txt b { color: #e0e0f0; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-sum-txt span,
.qw-sum-txt br + * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.qw-sum-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f4c942;
  color: #12122b;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
}

/* Body */
.qw-body { max-height: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.4,0,.2,1); }
.qw-body.qw-body--open { max-height: 700px; overflow-y: auto; }

/* Sections */
.qw-sec { padding: 8px 14px 4px; border-top: 1px solid rgba(255,255,255,.03); }
.qw-sl { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #666; margin-bottom: 8px; }

/* Quest row */
.qw-q { padding: 10px 12px; background: rgba(145,70,255,.03); border: 1px solid rgba(145,70,255,.06); border-radius: 10px; margin-bottom: 8px; transition: border-color .3s, opacity .3s; }
.qw-q--claim { border-color: rgba(244,201,66,.35); background: rgba(244,201,66,.04); }
.qw-q--done { opacity: .4; border-color: rgba(34,197,94,.15); }
.qw-q-name { font-size: 12px; font-weight: 600; color: #e8e8f4; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.qw-q--done .qw-q-name { color: #666; }
.qw-q-desc { font-size: 10px; color: #888; margin-bottom: 6px; line-height: 1.3; }
.qw-q-bar-row { display: flex; align-items: center; gap: 8px; }
.qw-bar { flex: 1; height: 5px; background: rgba(255,255,255,.04); border-radius: 99px; overflow: hidden; }
.qw-fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.qw-frac { font-size: 10px; color: #888; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.qw-q-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; flex-wrap: wrap; gap: 4px; }
.qw-rw { font-size: 9px; font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; }
.qw-rw-p { color: #f4c942; }
.qw-rw-d { color: #c8a0ff; }

/* Difficulty */
.qw-diff { font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 2px 6px; border-radius: 3px; flex-shrink: 0; }
.qw-diff.e { background: rgba(34,197,94,.1); color: #22c55e; }
.qw-diff.m { background: rgba(245,158,11,.1); color: #f59e0b; }
.qw-diff.h { background: rgba(239,68,68,.1); color: #ef4444; }

/* Claim */
.qw-claim { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 5px 14px; border-radius: 20px; background: linear-gradient(135deg,#f4c942,#e8b82a); color: #12122b; border: none; cursor: pointer; transition: transform .15s; flex-shrink: 0; animation: qw-pop .5s ease; }
.qw-claim:hover { transform: scale(1.04); }
.qw-claim:active { transform: scale(.96); }
.qw-claim--bonus { margin-left: auto; }
.qw-done-txt { font-size: 9px; color: #22c55e; font-weight: 600; }

/* Weekly bonus */
.qw-wb { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.03); flex-wrap: wrap; }
.qw-wb-dots { display: flex; gap: 4px; }
.qw-wb-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.03); border: 1.5px solid rgba(145,70,255,.12); transition: all .3s; }
.qw-wb-dot--f { background: #f4c942; border-color: #f4c942; }
.qw-wb-lbl { font-size: 9px; color: #666; flex: 1; }
.qw-wb-rw { font-size: 8px; font-weight: 700; color: #f4c942; }

/* Toast */
.qw-toast { position: fixed; bottom: 70px; left: 16px; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); border-radius: 10px; padding: 8px 16px; color: #22c55e; font-size: 11px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: all .3s; pointer-events: none; z-index: 901; max-width: 280px; }
.qw-toast.qw-toast--show { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════
   MOBILE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  .qw { bottom: 12px; left: 12px; }

  /* Pastille always visible on mobile */
  .qw-pill {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(16,14,38,.95); border: 2px solid rgba(145,70,255,.25);
    cursor: pointer; position: relative;
    transition: border-color .3s, transform .15s;
    -webkit-appearance: none; appearance: none; padding: 0;
  }
  .qw-pill:active { transform: scale(.92); }
  .qw-pill-ico { width: 22px; height: 22px; }
  .qw-pill-badge {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #f4c942; color: #12122b;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    animation: qw-pop .5s ease;
  }

  /* Card hidden by default on mobile */
  .qw-card {
    display: none;
    width: 270px;
    position: absolute;
    bottom: 56px; left: 0;
    border-radius: 14px;
  }

  /* Card visible when open */
  .qw--mobile-open .qw-card { display: block; animation: qw-slide-up .25s ease; }
  @keyframes qw-slide-up { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

  .qw--mobile-open .qw-body.qw-body--open { max-height: 55vh; }

  .qw-toast { left: 12px; bottom: 65px; max-width: 260px; }
  .qw-q-desc { font-size: 9px; }

  /* FIX: summary text overflow on mobile */
  .qw-sum-txt { font-size: 9px; }
  .qw-sum-item { padding: 5px 6px; gap: 4px; }
  .qw-sum-icon { width: 18px; height: 18px; font-size: 8px; }
}

@media (max-width: 380px) {
  .qw-pill { width: 42px; height: 42px; }
  .qw-pill-ico { width: 20px; height: 20px; }
  .qw-card { width: 250px; }
}