/* A single clipped background belongs to each player's entire row. */
#leaderboard tbody tr.theme-halloween-2026,.card-theme-preview.theme-halloween-2026{background-color:#15131f;background-image:linear-gradient(90deg,#080c184d 0%,#10102480 35%,#1010245c 68%,#16112220 100%),url('/assets/card-themes/halloween-desktop-v2.png');background-size:100% 100%,cover;background-position:center,center;background-repeat:no-repeat}
#leaderboard tr.theme-halloween-2026>td{background:transparent;border-block-color:#b477c52b;color:#eee4f4}
#leaderboard tr.theme-halloween-2026 .pilot-name{color:#f5e8fb;text-shadow:0 1px 4px #000}
#leaderboard tr.theme-halloween-2026:hover{filter:brightness(1.1)}
#leaderboard tbody tr.theme-feather-ss2,.card-theme-preview.theme-feather-ss2{
 background-color:#102136;background-image:linear-gradient(90deg,#09152475,transparent 64%,#09152485),url('/assets/card-themes/feather-ss2.png');
 background-size:100% 100%,cover;background-position:center,center 74%;background-repeat:no-repeat
}
#leaderboard tr.theme-feather-ss2>td{background:transparent;border-block-color:#91afb946;color:#edf5fe;text-shadow:0 1px 4px #071221}
#leaderboard tr.theme-feather-ss2 .pilot-name,.card-theme-preview.theme-feather-ss2>strong{color:#f3f7ff}
.card-theme-settings{min-width:0;margin-top:18px!important;padding:18px 20px!important}
.card-theme-description{font-size:15px;color:#93a5bd;line-height:1.8;margin:6px 0 10px}
.card-theme-preview{min-height:64px;display:flex;align-items:center;gap:14px;width:100%;min-width:0;border:1px solid #a589bd42;border-radius:10px;padding:12px 18px;background:#111b2c;overflow:hidden;box-sizing:border-box}
.card-preview-rank{width:29px;height:29px;flex:none;display:grid;place-items:center;border:1px solid #8496b650;border-radius:9px;color:#a4b4cb;font-size:15px}
.card-preview-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;flex:none;background:#29364a;color:#e7d2a8;overflow:hidden}
.card-preview-avatar img{width:100%;height:100%;object-fit:cover}
.card-theme-preview>strong{font-size:16px;overflow-wrap:anywhere;min-width:0;color:#f4e4ed;text-shadow:0 1px 4px #000}
.card-preview-score{margin-left:auto;font-size:15px;color:#d7c7df}
.card-theme-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:10px}
.card-theme-option{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:6px;padding:10px 14px;background:#172235;border:1px solid #9caac333;border-radius:8px;color:#d6dbe5;min-width:0;cursor:pointer}
.card-theme-option strong{font-size:16px;font-weight:500}.card-theme-option small{font-size:14px;color:#94a5bd;line-height:1.7}
.card-theme-option.selected{border-color:#c6a16d;background:#b58d4612}.card-theme-option.selected small{color:#e1c28e}
.card-theme-option:disabled:not(.selected){opacity:.55;cursor:default}.card-theme-option:focus-visible{outline:2px solid #e2c18e;outline-offset:3px}
.card-theme-message{font-size:15px;color:#d9bd8e;line-height:1.8;margin:12px 0 0}.card-theme-message:empty{display:none}
@media(max-width:680px){.card-theme-options{grid-template-columns:1fr}.card-theme-preview{gap:9px;padding:12px 10px}.card-preview-avatar{width:36px;height:36px}.card-theme-settings{padding:18px!important}}

@media(max-width:760px){#leaderboard tbody tr.theme-halloween-2026,.card-theme-preview.theme-halloween-2026{background-image:linear-gradient(90deg,#080c1870,#10102470 65%,#16112210),url('/assets/card-themes/halloween-mobile-v2.png')}}
/* Generated transparent avatar ring; portrait stays still inside the loop. */
#leaderboard .theme-halloween-2026 .pilot-avatar,.theme-halloween-2026 .card-preview-avatar,.profile-view .profile-monogram.avatar-frame-halloween{position:relative;isolation:isolate;overflow:visible}
#leaderboard :is(.theme-halloween-2026,.theme-feather-ss2) .pilot-identity{gap:12px}
.theme-halloween-2026 .card-preview-avatar img{border-radius:50%}
.profile-view .profile-monogram.avatar-frame-halloween{border-radius:50%;outline:0}
#leaderboard .theme-halloween-2026 .pilot-avatar::after,.theme-halloween-2026 .card-preview-avatar::after,.profile-view .profile-monogram.avatar-frame-halloween::after{content:'';position:absolute;inset:-23%;background:url('/assets/card-themes/halloween-avatar-frame-v1.png') center/contain no-repeat;z-index:2;pointer-events:none;transform-origin:center;animation:halloween-frame-glow 4s ease-in-out infinite}
.profile-view .profile-monogram.avatar-frame-halloween::after{inset:-29%}

#leaderboard .theme-feather-ss2 .pilot-avatar,
.theme-feather-ss2 .card-preview-avatar,
.profile-view .profile-monogram.avatar-frame-feather-ss2{
 position:relative;isolation:isolate;overflow:visible;border-radius:50%
}
.theme-feather-ss2 .card-preview-avatar img{border-radius:inherit}
.profile-view .profile-monogram.avatar-frame-feather-ss2{outline:0}
/* Match Halloween's visible width and portrait opening after the artwork's transparent margins. */
#leaderboard .theme-feather-ss2 .pilot-avatar::after,
.theme-feather-ss2 .card-preview-avatar::after,
.profile-view .profile-monogram.avatar-frame-feather-ss2::after{
 content:'';position:absolute;left:51.3%;top:54%;width:156%;height:156%;
 transform:translate(-50%,-50%);pointer-events:none;z-index:2;
 background:url('/assets/card-themes/feather-ss2-frame-poster.webp') center/contain no-repeat
}
.profile-view .profile-monogram.avatar-frame-feather-ss2::after{width:169%;height:169%}
@media(prefers-reduced-motion:no-preference){
 #leaderboard .theme-feather-ss2 .pilot-avatar::after,
 .theme-feather-ss2 .card-preview-avatar::after,
 .profile-view .profile-monogram.avatar-frame-feather-ss2::after{
  background-image:url('/assets/card-themes/feather-ss2-frame.webp')
 }
}

@keyframes halloween-frame-glow{0%,100%{filter:drop-shadow(0 0 1px #e6804470);opacity:.88}50%{filter:drop-shadow(0 0 2px #bf69ffb0);opacity:1}}
@media(prefers-reduced-motion:reduce){#leaderboard .theme-halloween-2026 .pilot-avatar::after,.theme-halloween-2026 .card-preview-avatar::after,.profile-view .profile-monogram.avatar-frame-halloween::after{animation:none}}
.halloween-avatar-elements{position:absolute;inset:-23%;z-index:3;pointer-events:none;overflow:visible}
.profile-monogram>.halloween-avatar-elements{inset:-29%}
.halloween-bat{position:absolute;left:-4%;top:-7%;width:34%;height:34%;background:url('/assets/card-themes/halloween-bat-sprites-v1.png') 0 0/200% 200% no-repeat;animation:halloween-bat-wings .8s steps(1,end) infinite,halloween-bat-drift 3.8s ease-in-out infinite}
.halloween-bat.bat-1{left:auto;top:auto;right:-5%;bottom:-4%;width:29%;height:29%;animation-delay:-.4s,-1.9s}
.halloween-spark{position:absolute;width:5%;height:5%;min-width:1px;min-height:1px;border-radius:50%;background:#ffc66b;box-shadow:0 0 3px #f58a32;animation:halloween-ember-rise 2.6s ease-out infinite;opacity:0}
.halloween-spark.spark-0{left:3%;top:53%}
.halloween-spark.spark-1{left:30%;top:92%;background:#dca4ff;box-shadow:0 0 3px #af55ff;animation-delay:-.6s}
.halloween-spark.spark-2{right:0;top:49%;animation-delay:-1.2s}
.halloween-spark.spark-3{left:54%;top:3%;background:#dca4ff;box-shadow:0 0 3px #af55ff;animation-delay:-1.8s}
.halloween-spark.spark-4{right:17%;top:83%;animation-delay:-2.3s}
@keyframes halloween-bat-wings{0%{background-position:0 0}25%{background-position:100% 0}50%{background-position:0 100%}75%{background-position:100% 100%}100%{background-position:0 0}}
@keyframes halloween-bat-drift{0%,100%{transform:translate(0,0) rotate(-8deg)}50%{transform:translate(2px,-3px) rotate(8deg)}}
@keyframes halloween-ember-rise{0%{transform:translate(0,3px) scale(.4);opacity:0}25%{opacity:1}75%{opacity:.8}100%{transform:translate(2px,-6px) scale(.2);opacity:0}}
@media(prefers-reduced-motion:reduce){.halloween-avatar-elements>*{animation:none!important}.halloween-spark{opacity:.7}}
