/* Finestra d'objectius de Draft 82 i Franchise Manager — mateixa maquetació que la del mode carrera (src/game.css). */
.challenges-overlay, .ach-toasts, .ach-entry{--md:#18181b; --row:#232327; --row2:#1c1c20; --ln:#2c2c31; --mute:#9a8f84; --dim:#8f857b; --eo:cubic-bezier(.22,1,.36,1)}
html.chd-open{overflow:hidden}
.challenges-overlay{position:fixed; inset:0; z-index:96; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(6,6,8,.74); opacity:0; pointer-events:none; transition:opacity .2s ease; overscroll-behavior:contain}
.challenges-overlay.show{opacity:1; pointer-events:auto}
.challenges-dialog{width:min(780px,100%); height:min(760px,calc(100vh - 40px)); height:min(760px,calc(100dvh - 40px)); display:flex; flex-direction:column; overflow:hidden;
  background:var(--md); border:1px solid var(--ln); border-radius:16px; box-shadow:0 30px 80px rgba(0,0,0,.65); transform:translateY(12px) scale(.98); transition:transform .25s var(--eo); font-family:'Manrope',system-ui,sans-serif; color:var(--ink); text-align:left}
.challenges-overlay.show .challenges-dialog{transform:none}
.challenges-dialog button{font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer}
.chd-hd{display:flex; align-items:center; gap:10px; padding:16px 22px; border-bottom:1px solid var(--ln); flex:none}
.chd-hd > svg{flex:none}
.chd-hd h2{margin:0; font:800 20px 'Sora',sans-serif; letter-spacing:-.01em}
.chd-info{position:relative; color:var(--mute); display:grid; place-items:center; border-radius:50%; cursor:help; flex:none}
.chd-info .chd-tip{position:absolute; top:26px; left:-110px; width:230px; background:#000; border:1px solid var(--ln); border-radius:8px; padding:8px 10px; font-size:11.5px; line-height:1.45; color:#e6ddd2; opacity:0; pointer-events:none; transition:opacity .15s ease; z-index:5; text-align:center}
.chd-info:hover .chd-tip, .chd-info:focus-visible .chd-tip{opacity:1}
.chd-tools{margin-left:auto; display:flex; align-items:center; gap:4px}
.chd-tools .chd-sep{width:1px; height:20px; background:var(--ln); margin:0 8px}
.challenges-dialog .chd-tb{width:32px; height:32px; flex:none; border-radius:50%; display:grid; place-items:center; color:var(--mute); transition:background .15s ease, color .15s ease, transform .1s ease}
.challenges-dialog .chd-tb:active{transform:scale(.92)}
.challenges-dialog .chd-tb:hover{color:var(--ink); background:var(--row)}
.challenges-dialog .chd-tb.on{background:var(--ink); color:#1a1612}
.challenges-dialog .chd-tb.chd-x{margin-left:6px}
.chd-sum{display:flex; align-items:center; gap:14px; padding:12px 22px; border-bottom:1px solid var(--ln); font-size:12.5px; color:var(--mute); flex:none}
.chd-sum b{color:var(--ink)}
.chd-prog{flex:1; display:block; height:6px; border-radius:6px; background:var(--row); overflow:hidden}
.chd-prog i{display:block; height:100%; background:linear-gradient(90deg,#c2570c,var(--accent),#ffd27a); transition:width .5s var(--eo)}
.chd-note{display:flex; align-items:center; gap:12px; padding:9px 22px; background:#1d1d22; border-bottom:1px solid var(--ln); font-size:12.5px; color:var(--mute); flex:none}
.challenges-dialog .chd-note-btn{margin-left:auto; padding:6px 14px; border-radius:999px; background:var(--ink); color:#1a1612; font-weight:700; font-size:12px; white-space:nowrap}
.chd-body{flex:1; overflow:auto; padding:16px 18px 20px}
.chd-body::-webkit-scrollbar{width:8px} .chd-body::-webkit-scrollbar-thumb{background:#3a3a40; border-radius:8px}
.chg{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.ach{position:relative; display:flex; gap:14px; align-items:center; padding:12px 14px; border-radius:12px; background:var(--row); min-height:88px; min-width:0; transition:transform .15s}
.ach:hover{transform:translateY(-1px)}
.ach:not(.lk){box-shadow:inset 0 0 0 1px rgba(245,166,35,.16)}
.ach-ic{width:64px; height:64px; border-radius:12px; flex:none; display:grid; place-items:center; background:var(--g); position:relative; overflow:hidden; box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 6px 16px -8px rgba(0,0,0,.6)}
.ach-ic::before{content:''; position:absolute; inset:0; background:radial-gradient(120% 80% at 20% 0%,rgba(255,255,255,.45),transparent 55%), repeating-linear-gradient(135deg,rgba(255,255,255,.07) 0 3px,transparent 3px 9px)}
.ach-ic::after{content:''; position:absolute; left:-60%; top:0; width:40%; height:100%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent); transform:skewX(-20deg); transition:left .6s}
.ach:hover .ach-ic::after{left:130%}
.ach-ic svg{position:relative; width:46px; height:46px; filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}
.ach-tx{min-width:0; flex:1}
.ach-tx h3{font:700 16.5px/1.25 'Sora',sans-serif; letter-spacing:-.01em; margin:0}
.ach-tx p{font-size:12.5px; color:var(--mute); margin:3px 0 0; line-height:1.35}
.ach-date{position:absolute; top:10px; right:10px; font-size:11px; font-weight:800; background:#36363c; color:#efe7dd; padding:2px 8px; border-radius:99px}
.ach.dn .ach-tx h3{padding-right:70px} .chg.tiles .ach.dn .ach-tx h3{padding-right:0}
.ach-rar{display:inline-block; font:800 9px 'Manrope',sans-serif; letter-spacing:.1em; text-transform:uppercase; margin-left:6px; vertical-align:2px; color:var(--rc)}
.ach-pb{display:flex; align-items:center; gap:8px; margin-top:7px}
.ach-pb .t{flex:1; height:4px; border-radius:4px; background:#2e2e33; overflow:hidden}
.ach-pb .t i{display:block; height:100%; background:#7a5a2c; border-radius:4px}
.ach-pb span{font-size:10.5px; font-weight:700; color:var(--dim); font-variant-numeric:tabular-nums}
.ach.lk{background:var(--row2)}
.ach.lk .ach-ic{background:#26262a; box-shadow:none}
.ach.lk .ach-ic::before, .ach.lk .ach-ic::after{display:none}
.ach.lk .ach-ic svg{filter:grayscale(1) brightness(.32) contrast(.9); opacity:.85}
.ach.lk .ach-tx h3{color:#e6ddd2}
.ach.lk .ach-tx p{color:var(--dim)}
.chg.tiles{grid-template-columns:repeat(4,1fr)}
.chg.tiles .ach{flex-direction:column; text-align:center; padding:18px 12px 14px}
.chg.tiles .ach-tx{width:100%; flex:none}
.chg.tiles .ach-tx h3{font-size:14px}
.chg.tiles .ach-rar{display:block; margin:4px 0 0}
.chg.tiles .ach-date{position:static; order:3}
.chd-empty{text-align:center; color:var(--dim); padding:40px; grid-column:1/-1; margin:0}

/* botó d'entrada dins la pàgina */
.ach-entry{display:flex; align-items:center; gap:14px; width:100%; max-width:520px; margin-top:22px; padding:14px 16px; border-radius:12px; border:1px solid var(--ln); background:var(--md); color:var(--ink); text-align:left; font-family:'Manrope',system-ui,sans-serif; cursor:pointer}
.ach-entry:hover{border-color:var(--accent)}
.ach-entry > svg{flex:none; color:var(--accent); width:30px; height:30px}
.ach-entry-tx{display:flex; flex-direction:column; gap:8px; flex:1; min-width:0}
.ach-entry-tx b{font:700 15px 'Sora',sans-serif}
.ach-entry-tx .chd-prog{flex:none}
.ach-entry-n{display:flex; flex-direction:column; align-items:flex-end; flex:none}
.ach-entry-n b{font:800 15px 'Sora',sans-serif; font-variant-numeric:tabular-nums}
.ach-entry-n small{font-size:11.5px; font-weight:700; color:var(--accent)}

/* avís d'objectiu desbloquejat */
.ach-toasts{position:fixed; right:max(18px, env(safe-area-inset-right)); bottom:max(18px, env(safe-area-inset-bottom)); z-index:97; display:flex; flex-direction:column; gap:10px; pointer-events:none; max-width:calc(100vw - 36px)}
.ach-toast{position:relative; display:flex; align-items:center; gap:12px; min-width:260px; max-width:340px; padding:10px 14px 10px 10px; border-radius:12px; color:var(--ink); background:var(--md); border:1px solid rgba(245,197,66,.5); box-shadow:0 14px 40px -10px rgba(0,0,0,.75); opacity:0; transform:translateX(30px) scale(.96); transition:opacity .4s ease, transform .5s cubic-bezier(.34,1.56,.64,1)}
.ach-toast.show{opacity:1; transform:none}
.ach-toast .ach-ic{width:54px; height:54px}
.ach-toast .ach-ic svg{width:38px; height:38px}
.ach-kicker{font-size:9.5px; font-weight:900; letter-spacing:.14em; text-transform:uppercase; color:#fbbf24}
.ach-name{font:700 14px 'Sora',sans-serif; margin-top:1px}
.ach-sub{font-size:11px; color:var(--mute); margin-top:1px; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}

@media (max-width:640px){ .chg{grid-template-columns:1fr} .chg.tiles{grid-template-columns:1fr 1fr} .chd-tools .chd-sep, .chd-tools .chd-hide-sm{display:none} }
@media (max-width:560px){
  .chd-hd{flex-wrap:wrap; gap:6px 8px; padding:12px 14px}
  .chd-hd h2{font-size:18px; min-width:0; flex:1 1 0}
  .chd-tools{flex:1 1 100%; margin-left:0; justify-content:flex-end}
  .chd-sum{padding:10px 14px}
  .chd-note{padding:9px 14px}
  .chd-info .chd-tip{left:auto; right:-14px}
}
@media (max-width:760px){
  .challenges-overlay{padding:10px}
  .challenges-dialog{height:calc(100vh - 20px); height:calc(100dvh - 20px)}
}
@media (pointer:coarse){ .challenges-dialog .chd-tb{width:44px; height:44px} }
@media (prefers-reduced-motion:reduce){ .challenges-overlay, .challenges-dialog, .ach, .ach-ic::after, .ach-toast{transition:none} .challenges-dialog, .ach-toast{transform:none} .ach:hover{transform:none} }
