/* Event page layout inherits saved style per event; compact and adaptive. */
.crafter-event-custom-layout{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  background:var(--event-page-bg,#141414);
  color:var(--event-text,#fff);
  font-family:var(--event-font,inherit);
}
.crafter-event-custom-layout .crafter-event-layout-block{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
  overflow:visible;
}
.crafter-event-custom-layout .crafter-event-header{margin:0;padding:5px 0 11px}
.crafter-event-custom-layout .crafter-event-name h1{
  font-family:var(--event-heading-font,inherit);
  font-size:var(--event-heading-size,26px);
  color:var(--event-heading,#fff);
  font-weight:900;
}
.crafter-event-custom-layout .crafter-event-countdown{font-family:var(--event-font,inherit)}
.crafter-event-custom-layout .crafter-event-rank-list{
  gap:var(--event-row-gap,8px);
  max-width:100%;
}
.crafter-event-custom-layout .crafter-event-leader{
  background:var(--event-row-bg,#242229);
  border-color:var(--event-row-border,#36313d);
  border-radius:var(--event-row-radius,14px);
  color:var(--event-text,#fff);
  min-width:0;
}
.crafter-event-custom-layout .crafter-event-leader-info>strong{
  font-size:var(--event-name-size,13px);
  color:var(--event-text,#fff);
}
.crafter-event-custom-layout .crafter-event-score{
  color:var(--event-score,#bbb6c7);
  font-size:var(--event-score-size,12px);
}
.crafter-event-custom-layout .crafter-rank-prize-art{
  width:var(--event-prize-size,55px);
  height:var(--event-prize-size,55px);
  flex-basis:var(--event-prize-size,55px);
}
.crafter-event-custom-layout .crafter-event-layout-text p{
  margin:0;
  min-width:0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  line-height:1.4;
}
.crafter-event-custom-layout .crafter-event-layout-timer{
  display:flex;align-items:center;justify-content:center;
}
.crafter-event-custom-layout .crafter-event-layout-timer .crafter-event-countdown{
  width:max-content;
  max-width:100%;
}
.crafter-event-custom-layout .crafter-event-layout-divider{
  border:0;height:1px;background:#ffffff23;margin:9px 0;
}
.crafter-event-custom-layout .crafter-event-page-banner{
  width:100%;min-width:0;display:block;
  isolation:isolate;
}
.crafter-event-custom-layout .crafter-event-page-banner .ice-banner-stage{
  border-radius:inherit;
}
@media(max-width:420px){
 .crafter-event-custom-layout .crafter-rank-prize-art{
  width:min(var(--event-prize-size,55px),18vw);
  height:min(var(--event-prize-size,55px),18vw);
  flex-basis:min(var(--event-prize-size,55px),18vw);
 }
 .crafter-event-custom-layout .crafter-event-name h1{
  font-size:min(var(--event-heading-size,26px),7vw);
 }
}


/* Shared top strip: up to four banners, distinct and individually clickable.
   Preserve original bottom navigation on every screen size. */
.crafter-event-top-banners{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(0,100%);
  gap:12px;
  width:100%;
  min-width:0;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  padding:4px 2px 12px;
  margin:0 0 10px;
  scroll-snap-type:x mandatory;
  scrollbar-width:thin;
  scrollbar-color:#6e7184 transparent;
  overscroll-behavior-inline:contain;
}
.crafter-event-top-banners>.crafter-event-layout-banner{
  min-width:0;
  scroll-snap-align:start;
  display:flex;
  flex-direction:column;
}
.crafter-event-top-banners .crafter-event-page-banner{flex:1 1 auto;min-width:0}
.crafter-event-top-banners .ice-banner-stage{
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}
.crafter-event-top-banners .ice-banner-stage[role=link]{
  cursor:pointer;
  transition:filter .18s ease;
}
.crafter-event-top-banners .ice-banner-stage[role=link]:hover{filter:brightness(1.08)}
.crafter-event-top-banners .ice-banner-stage[role=link]:focus-visible{
  outline:2px solid #81cfff;
  outline-offset:3px;
}
@media(min-width:740px){
 .crafter-event-top-banners{
  grid-auto-flow:row;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-columns:auto;
  overflow:visible;
 }
}
@media(min-width:1240px){
 .crafter-event-top-banners{grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
}
/* Event layouts occupy the available desktop canvas but retain the mini-app
   framing, the compact player rows and the unchanged bottom navigation. */
@media(min-width:1050px){
 #app:has(.crafter-event-custom-layout){max-width:min(96vw,1550px)}
 #app:has(.crafter-event-custom-layout) #main{padding-left:clamp(18px,2vw,32px);padding-right:clamp(18px,2vw,32px)}
 .crafter-event-custom-layout{max-width:none;width:100%}
 .crafter-event-custom-layout .crafter-event-rank-list{
   display:grid;
   grid-template-columns:repeat(2,minmax(0,1fr));
   gap:var(--event-row-gap,8px);
 }
}
@media(min-width:1440px){
 .crafter-event-custom-layout .crafter-event-rank-list{
   grid-template-columns:repeat(3,minmax(0,1fr));
 }
}
