/* V11: approved tournament/training headers. Ordinary cards keep their layout.
   The tournament's training tab is deliberately not selected by these rules. */
html body details.am-ui-card .am-ui-side{justify-content:stretch!important;justify-items:end!important;text-align:right!important;}
html body details.am-ui-card .am-ui-side>.am-ui-result{justify-self:end!important;justify-content:flex-end!important;text-align:right!important;}
html body details.am-ui-card .am-ui-side>.am-ui-result:not(:empty){padding-right:0!important;}
html body details.am-ui-card.am-ui-state-win .am-ui-side>.am-ui-result{padding-right:6px!important;}
html body details.am-ui-card .am-ui-chevron{
  width:18px!important;height:12px!important;margin:0!important;justify-self:end!important;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M2 3l7 6 7-6' fill='none' stroke='%23e6c071' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px 12px no-repeat!important;
  transform:none!important;transform-origin:center!important;
}
html body details.am-ui-card[open] .am-ui-chevron{transform:rotate(180deg)!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card{
  --am-ui-heading-font:15px;--am-ui-score-size:23px;--am-ui-event-font:13px;
  --am-ui-border:#8e7c56;--am-ui-shadow:none;
}
html body .wapper .content details.am-ui-card.am-ui-event-card>summary.am-ui-summary{
  --am-ui-rows:4;--am-ui-thumb:var(--am-event-thumb,114px);--am-ui-side:var(--am-event-side,98px);--am-ui-gap:var(--am-event-col-gap,12px);
  display:grid!important;grid-template-columns:var(--am-ui-thumb) minmax(0,1fr) var(--am-ui-side)!important;
  grid-template-rows:var(--am-event-rows,minmax(27px,auto) minmax(22px,auto) minmax(18px,auto) minmax(20px,auto))!important;
  gap:var(--am-event-row-gap,8px) var(--am-ui-gap)!important;height:auto!important;min-height:var(--am-event-min-height,148px)!important;max-height:none!important;
  padding:var(--am-event-padding,13px)!important;align-content:var(--am-event-align,stretch)!important;overflow:visible!important;
  background:linear-gradient(105deg,#e9ba6426,#e9ba640e 43%,#e9ba6400 82%),#1b222d!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training{--am-ui-border:#7096a7;}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training>summary.am-ui-summary{
  background:linear-gradient(105deg,#5193b529,#5193b50c 55%,#5193b500 84%),#172331!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-live{--am-ui-border:#b49b62;}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-live>summary.am-ui-summary{
  background:linear-gradient(105deg,#efbf6638,#efbf6615 43%,#efbf6600 84%),#1b222d!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card>summary>.am-ui-event{
  display:flex!important;grid-column:var(--am-event-title-column,1/3)!important;grid-row:1!important;align-items:center!important;align-self:center!important;
  flex-wrap:wrap!important;gap:3px 5px!important;width:100%!important;min-width:0!important;
  font-size:13px!important;line-height:1.4!important;font-weight:700!important;white-space:normal!important;
  color:#edcf8f!important;-webkit-text-fill-color:currentColor!important;
  background:none!important;animation:none!important;overflow:visible!important;text-overflow:clip!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-event-label{
  background-clip:text!important;-webkit-background-clip:text!important;color:transparent!important;-webkit-text-fill-color:transparent!important;
  animation:am-event-label-shimmer 5.5s ease-in-out infinite!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card:not(.am-ui-training) .am-ui-event-label{
  background:linear-gradient(100deg,#f4dba2,#eac778 30%,#fff0c6 50%,#eac778 70%,#f4dba2) 100% 0/230% 100%!important;
  background-clip:text!important;-webkit-background-clip:text!important;
}
html body .wapper .content details.am-ui-card.am-ui-training .am-ui-event-label{
  background-image:linear-gradient(100deg,#f4fcff,#e2f7ff 28%,#94d4ed 50%,#e2f7ff 72%,#f4fcff)!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-event-stage{font-size:12px!important;color:#edcf8f!important;overflow-wrap:anywhere!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-event-cup{font-size:13px!important;line-height:1!important;color:#e9c575!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-thumb{
  grid-row:var(--am-event-photo-row,2/-1)!important;width:var(--am-ui-thumb)!important;height:var(--am-event-photo-height,86px)!important;align-self:center!important;margin:0!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-copy{
  grid-row:2/-1!important;grid-template-rows:subgrid!important;row-gap:inherit!important;height:auto!important;align-self:stretch!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-copy>.am-ui-heading{
  grid-row:1!important;font-size:var(--am-ui-heading-font)!important;line-height:1.4!important;
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important;width:100%!important;max-width:100%!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card :is(.am-ui-server,.am-ui-map-name){white-space:normal!important;overflow-wrap:anywhere!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-meta{grid-row:2!important;width:100%!important;max-width:100%!important;white-space:normal!important;overflow:visible!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-extras{
  grid-row:3!important;align-self:center!important;flex-wrap:wrap!important;width:100%!important;max-width:100%!important;overflow:visible!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-side{grid-row:1/-1!important;grid-template-rows:subgrid!important;row-gap:inherit!important;height:auto!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-score{grid-row:1!important;align-self:center!important;transform:none!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-result{grid-row:3!important;align-self:center!important;}
html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-chevron{grid-row:var(--am-event-chevron-row,4)!important;align-self:center!important;margin:0!important;}

/* Official tournament cards share the existing completed-match template.
   The sole additional header cell is the centred stage. */
html body .automix details.gma-match.am-tour-card.am-tour-official{border-color:#8e805f!important;background:#1b2028!important;}
html body .wapper .content .automix details.gma-match.am-tour-card.am-tour-official>summary.gma-match-head.am-tour-match-summary{
  background:linear-gradient(105deg,#e9ba641c,#e9ba640b 46%,#e9ba6400 84%),#1b2028!important;
}
html body .wapper .content .automix details.gma-match.am-tour-card.am-tour-official.am-tour-is-live>summary.gma-match-head.am-tour-match-summary{
  background:linear-gradient(105deg,#efbf6638,#efbf6615 48%,#efbf6600 88%),#1b2028!important;
}
html body .automix .am-tour-official .am-tour-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr) minmax(0,1fr);align-items:center;gap:8px;}
html body .automix .am-tour-official .am-tour-server{white-space:normal;overflow-wrap:anywhere;font-size:clamp(11px,1.8cqw,18px);}
html body .automix .am-tour-official .am-tour-stage{min-width:0;text-align:center;justify-self:center;font-size:clamp(11px,1.8cqw,18px);line-height:1.35;font-weight:700;color:#edcf8f;overflow-wrap:anywhere;}
html body .automix .am-tour-official .am-tour-body{grid-template-columns:clamp(76px,12.2cqw,180px) minmax(0,1fr) clamp(76px,12.2cqw,180px);}
html body .automix .am-tour-official .am-tour-side{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr auto 1fr;justify-items:end;align-items:center;justify-content:stretch;height:100%;align-self:stretch;min-height:60px;}
html body .automix .am-tour-official .am-tour-date{grid-row:1;align-self:start;max-width:100%;white-space:nowrap;text-align:right;font-size:clamp(10px,1.2cqw,12px);}
html body .automix .am-tour-official .am-tour-side>.am-tour-status{grid-row:2;}
html body .automix .am-tour-official .am-tour-side>.am-tour-details{grid-row:3;align-self:end;}
html body .automix .am-tour-official.am-tour-is-live .am-tour-duration{border:0;padding:0;}
html body .automix .am-tour-official .am-tour-side>.am-tour-status{font-size:clamp(11px,1.4cqw,16px);}
@keyframes am-event-label-shimmer{0%,100%{background-position:100% 0}50%{background-position:0 0}}
@media(max-width:650px){
  html body .wapper .content details.am-ui-card.am-ui-event-card{--am-ui-heading-font:12px;--am-ui-score-size:20px;}
  html body .wapper .content details.am-ui-card.am-ui-event-card>summary.am-ui-summary{
    --am-ui-thumb:var(--am-event-thumb,86px);--am-ui-side:var(--am-event-side,72px);--am-ui-gap:var(--am-event-col-gap,9px);min-height:var(--am-event-min-height,130px)!important;padding:var(--am-event-padding,10px)!important;
    grid-template-rows:var(--am-event-rows,minmax(24px,auto) minmax(22px,auto) minmax(18px,auto) minmax(20px,auto))!important;
  }
  html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-thumb{height:var(--am-event-photo-height,65px)!important;}
  html body .wapper .content details.am-ui-card.am-ui-event-card>summary>.am-ui-event{font-size:12px!important;}
  html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-event-stage{font-size:11px!important;}
  html body .automix .am-tour-official .am-tour-top{grid-template-columns:minmax(0,1fr) auto;}
  html body .automix .am-tour-official .am-tour-stage{grid-column:1/-1;grid-row:2;}
  html body .automix .am-tour-official .am-tour-body{grid-template-columns:76px minmax(0,1fr);gap:8px;}
  html body .automix .am-tour-official .am-tour-side{display:flex;grid-column:1/-1;flex-direction:row;align-items:center;gap:8px;min-height:0;}
  html body .automix .am-tour-official .am-tour-date{text-align:left;font-size:10px;}
}
@media(max-width:380px){
  html body .wapper .content details.am-ui-card.am-ui-event-card>summary.am-ui-summary{--am-ui-thumb:var(--am-event-thumb,70px);--am-ui-side:var(--am-event-side,65px);--am-ui-gap:var(--am-event-col-gap,7px);}
  html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-thumb{height:var(--am-event-photo-height,53px)!important;}
  html body .wapper .content details.am-ui-card.am-ui-event-card{--am-ui-score-size:18px;}
}
@media(prefers-reduced-motion:reduce){
  html body .wapper .content details.am-ui-card.am-ui-event-card .am-ui-event-label,
  html body details.am-ui-card .am-ui-live-dot,html body .automix .am-tour-card .am-tour-live-dot{animation:none!important;}
}

/* V12: training cards use ordinary thumbnail sizes. The extra heading belongs
   above the copy, not above the image. An empty public footer consumes no row.
   These parameters are never set on official or in-tournament cards. */
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training{
  --am-ui-score-size:21px;
  --am-event-thumb:74px;--am-event-photo-height:56px;
  --am-event-photo-row:1/-1;--am-event-title-column:2;
  --am-event-min-height:102px;--am-event-padding:10px 14px;
  --am-event-rows:minmax(21px,auto) minmax(21px,auto) minmax(16px,auto) minmax(20px,auto);
  --am-event-row-gap:3px;--am-event-align:center;
}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training:not(.am-ui-live):has(.am-ui-extras>.am-ui-spacer:only-child){
  --am-event-rows:minmax(21px,auto) minmax(21px,auto) minmax(16px,auto);
  --am-event-chevron-row:3;
}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-personal:not(.am-ui-live){
  --am-event-thumb:92px;--am-event-photo-height:70px;
}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training .am-ui-extras{
  width:calc(100% + var(--am-ui-side) + var(--am-ui-gap) - 24px)!important;max-width:none!important;
}
html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training .am-ui-event-label{
  display:inline-block;
  /* No important background-position: it would override the animation. */
  background-image:linear-gradient(100deg,#64d2ed 0%,#b8f2fb 25%,#32bfd3 50%,#8ae7ed 75%,#64d2ed 100%)!important;
  background-size:280% 100%!important;background-repeat:no-repeat!important;
  animation:am-training-title-wave 4.5s ease-in-out infinite!important;
}
@keyframes am-training-title-wave{
  0%,100%{background-position:100% 50%;text-shadow:0 0 5px #53d8ee18;}
  50%{background-position:0 50%;text-shadow:0 0 7px #53d8ee55;}
}
@media(max-width:650px){
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training{
    --am-ui-score-size:18px;
    --am-event-thumb:52px;--am-event-photo-height:40px;--am-event-side:74px;--am-event-col-gap:9px;
    --am-event-min-height:100px;--am-event-padding:8px 10px;
    --am-event-rows:minmax(20px,auto) minmax(18px,auto) minmax(14px,auto) minmax(17px,auto);
  }
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training:not(.am-ui-live):has(.am-ui-extras>.am-ui-spacer:only-child){
    --am-event-rows:minmax(20px,auto) minmax(18px,auto) minmax(14px,auto);
  }
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-live,
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-personal:not(.am-ui-live){
    --am-event-thumb:42px;--am-event-photo-height:42px;--am-event-side:62px;--am-event-col-gap:7px;
    --am-event-padding:8px;
  }
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-personal{--am-ui-score-size:16px;}
}
@media(max-width:340px){
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training{
    --am-ui-score-size:16px;
    --am-event-thumb:46px;--am-event-photo-height:36px;--am-event-side:68px;--am-event-col-gap:8px;
    --am-event-min-height:98px;--am-event-padding:8px 9px;
  }
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-live,
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-personal:not(.am-ui-live){
    --am-event-thumb:34px;--am-event-photo-height:34px;--am-event-side:54px;--am-event-col-gap:6px;
  }
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training.am-ui-personal{--am-ui-score-size:14px;}
}
@media(prefers-reduced-motion:reduce){
  html body .wapper .content details.am-ui-card.am-ui-event-card.am-ui-training .am-ui-event-label{animation:none!important;}
}
