/* Late arrivals (arrivals.js): the home-page announcement that new castaways have entered the
   game, a newcomer's arrival trial and tribe pick, and the commissioner's pointer to members
   still waiting on the beach. Tribe colours arrive as --t from tribe-info.js. */
.arrival{position:relative;margin:0 0 24px;border:1px solid rgba(228,185,93,.45);border-radius:18px;overflow:hidden;background:#0c1110;box-shadow:0 24px 55px rgba(0,0,0,.34),inset 0 1px rgba(244,216,157,.08)}
.arrival-scene{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:330px;padding:46px 42px 30px;background:linear-gradient(90deg,rgba(4,8,8,.95) 0%,rgba(4,8,8,.72) 40%,rgba(4,8,8,.1) 76%),linear-gradient(0deg,#0c1110 2%,rgba(12,17,16,0) 44%),url('assets/island.webp') 62% center/cover}
.arrival-call{margin:0;font:800 clamp(58px,9.5vw,124px)/.84 var(--display);text-transform:uppercase;letter-spacing:.005em;color:var(--gold);text-shadow:0 0 38px rgba(255,107,36,.42),0 4px 18px #000}
.arrival-title{margin:16px 0 0;max-width:640px;font-size:clamp(27px,3.5vw,44px);line-height:1;text-wrap:balance;text-shadow:0 3px 16px #000}
.arrival-lede{margin:14px 0 0;max-width:640px;font-size:16px;line-height:1.55;color:#ddd6c9;text-shadow:0 2px 10px #000}

/* The newcomers, one plate each */
.arrival-cast{list-style:none;margin:0;padding:4px 42px 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:12px}
.arrival-cast.is-duel{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
.arrival-plate{display:flex;align-items:center;gap:14px;min-width:0;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#111715}
.arrival-plate.has-buff{border-color:color-mix(in srgb,var(--t) 48%,transparent);background:linear-gradient(100deg,color-mix(in srgb,var(--t) 11%,transparent),transparent 62%),#111715}
.arrival-plate.is-you{box-shadow:inset 0 0 0 1px rgba(228,185,93,.5)}
.arrival-avatar{flex:none;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;font:800 18px/1 var(--display);letter-spacing:.04em;color:#1b0c05;background:linear-gradient(135deg,#f0cf85,#a8742c)}
.arrival-who{flex:1;min-width:0}
.arrival-who strong{display:block;font:700 23px/1.05 var(--display);text-transform:uppercase;letter-spacing:.02em;overflow-wrap:anywhere}
.arrival-who em{display:inline-block;vertical-align:3px;margin-left:6px;padding:2px 7px;border-radius:99px;background:rgba(228,185,93,.16);color:var(--gold);font:700 11px/1.3 var(--body);letter-spacing:.06em;text-transform:none}
.arrival-who small{display:block;margin-top:5px;font-size:13px;line-height:1.35;color:var(--muted)}
.arrival-plate.is-won .arrival-who small{color:#8fcf9d}
.arrival-plate.is-active .arrival-who small{color:var(--gold)}
.arrival-buff{flex:none;display:flex;flex-direction:column;align-items:center;gap:3px;width:76px;text-align:center}
.arrival-buff img{width:58px;height:58px;object-fit:contain;filter:drop-shadow(0 6px 8px rgba(0,0,0,.55))}
.arrival-buff small{font-size:11px;line-height:1.2;color:var(--muted)}
.arrival-plate.has-buff .arrival-buff small{color:var(--t)}
.arrival-buff.is-open span{display:grid;place-items:center;width:46px;height:46px;border:1px dashed rgba(228,185,93,.55);border-radius:12px;font:700 24px/1 var(--display);color:var(--gold)}
/* Two arrivals, two buffs nobody wears yet */
.arrival-stake{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:0 8px;text-align:center}
.arrival-stake div{display:flex}
.arrival-stake img{width:56px;height:56px;margin:0 -8px;object-fit:contain;filter:drop-shadow(0 6px 8px rgba(0,0,0,.6))}
.arrival-stake small{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)}
.arrival-foot{margin:14px 42px 22px;font-size:13px;color:var(--muted)}

/* A newcomer's own trial and tribe pick */
.arrival-you{padding:24px 42px 30px;border-top:1px solid rgba(228,185,93,.24);background:linear-gradient(180deg,rgba(228,185,93,.07),transparent 42%)}
.arrival-you h3{font-size:29px}
.arrival-you>p{max-width:720px;margin:8px 0 0;color:#d8d2c5}
.arrival-you>p strong{color:var(--bone)}
.arrival-you>h3:not(:first-child),.arrival-you>.buff-wait,.arrival-you>.buff-result{margin-top:24px}
.trial-games{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:18px 0 12px}
.trial-game{display:flex;flex-direction:column;overflow:hidden;border:1px solid #716145;border-radius:12px;background:#101c19}
.trial-game img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
.trial-game strong{padding:10px 10px 0;font-size:15px;line-height:1.25}
.trial-game small{padding:3px 10px 0;font-size:12px;color:#d5b778}
.trial-game div{display:flex;flex-direction:column;gap:7px;margin-top:auto;padding:12px 10px 10px}
.trial-game .btn{padding:9px 8px;font-size:13px}
.buff-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:780px;margin-top:18px}
.buff-choice{display:grid;grid-template-columns:96px minmax(0,1fr);column-gap:16px;row-gap:4px;align-items:center;padding:16px;border:1px solid color-mix(in srgb,var(--t) 52%,transparent);border-radius:14px;background:radial-gradient(ellipse at 18% 30%,color-mix(in srgb,var(--t) 18%,transparent),transparent 70%),#0b1210}
.buff-choice img{grid-row:1/5;width:96px;height:96px;object-fit:contain;filter:drop-shadow(0 10px 12px rgba(0,0,0,.55))}
.buff-choice h4{margin:0;font:700 32px/1 var(--display);text-transform:uppercase;letter-spacing:.02em;color:var(--t)}
.buff-choice p{margin:0;font-size:13px;color:var(--muted)}
.buff-choice .btn{justify-self:start;margin-top:8px}
.buff-result{display:flex;align-items:center;gap:18px;max-width:720px;padding:14px 18px;border:1px solid color-mix(in srgb,var(--t) 52%,transparent);border-radius:14px;background:linear-gradient(100deg,color-mix(in srgb,var(--t) 14%,transparent),transparent 66%)}
.buff-result img{flex:none;width:84px;height:84px;object-fit:contain;filter:drop-shadow(0 10px 12px rgba(0,0,0,.55))}
.buff-result h3{color:var(--t)}
.buff-result p{margin:6px 0 0;font-size:14px;color:#d8d2c5}
.buff-wait{font-size:14px}

/* Commissioner only */
.arrival-admin{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 18px;padding:14px 18px;border:1px dashed rgba(228,185,93,.6);border-radius:14px;background:#13150f}
.arrival-admin p{margin:5px 0 0;font-size:14px;line-height:1.5;color:#d8d2c5}
.arrival-admin p strong{color:var(--bone)}
.arrival-admin .btn{flex:none}

/* Elsewhere: the catch-up list, standings, results and the Tribes page */
.home-tasks.is-arrival{border-color:rgba(228,185,93,.6)}
.joined-label{display:block;font-size:11px;color:var(--muted);white-space:nowrap}
.ep-row.not-yet{opacity:.6}
.tribe-beach{margin:18px 0 0;padding:12px 16px;border:1px dashed rgba(228,185,93,.45);border-radius:12px;font-size:14px;color:#d8d2c5}
.tribe-beach strong{color:var(--bone)}
/* Home tribe banner for a newcomer who has no buff yet: both are still on the table */
.tribe-banner-pair{display:flex;flex:none;padding:0 6px}
.tribe-banner .tribe-banner-pair img{width:54px;height:64px;margin:0 -7px}

/* The first time a wave is seen, the announcement plays in once */
@keyframes arrival-dawn{from{opacity:0}}
@keyframes arrival-rise{from{opacity:0;transform:translateY(16px)}}
.is-reveal .arrival{animation:arrival-dawn 1.1s ease-out both}
.is-reveal .arrival-call{animation:arrival-rise .8s .55s cubic-bezier(.2,.7,.2,1) both}
.is-reveal .arrival-title{animation:arrival-rise .7s 1.3s cubic-bezier(.2,.7,.2,1) both}
.is-reveal .arrival-lede{animation:arrival-rise .7s 1.9s cubic-bezier(.2,.7,.2,1) both}
.is-reveal .arrival-plate,.is-reveal .arrival-stake{animation:arrival-rise .6s calc(2.6s + var(--i,0)*.38s) cubic-bezier(.2,.7,.2,1) both}
.is-reveal .arrival-foot,.is-reveal .arrival-you{animation:arrival-dawn .7s 3.9s ease-out both}
@media(prefers-reduced-motion:reduce){.is-reveal .arrival,.is-reveal .arrival *{animation:none}}

@media(max-width:980px){.trial-games{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
 .arrival-cast.is-duel{grid-template-columns:1fr}
 .arrival-stake{flex-direction:row;gap:14px;padding:2px 0}
 .buff-choices{grid-template-columns:1fr}
 .arrival-admin{flex-direction:column;align-items:flex-start}
}
@media(max-width:640px){
 .arrival-scene{min-height:300px;padding:34px 20px 22px;background-position:58% center}
 .arrival-lede{font-size:15px}
 .arrival-cast{padding:4px 14px 0;grid-template-columns:1fr}
 .arrival-foot{margin:12px 16px 18px}
 .arrival-you{padding:20px 16px 24px}
 .arrival-who strong{font-size:21px}
 .trial-games{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 /* the fifth game runs the full width, picture beside the buttons */
 .trial-game:last-child:nth-child(odd){grid-column:1/-1;display:grid;grid-template-columns:42% minmax(0,1fr);grid-template-rows:auto auto 1fr}
 .trial-game:last-child:nth-child(odd) img{grid-row:1/4;height:100%;aspect-ratio:auto}
 .buff-choice{grid-template-columns:76px minmax(0,1fr)}
 .buff-choice img{width:76px;height:76px}
 .buff-result img{width:64px;height:64px}
}
