/* The tournament window owns its layout; action buttons keep the game's native states. */
#dlgTL {
  --tl-title:"Yeseva One",Georgia,serif;
  box-sizing:border-box; width:min(890px,96vw); max-width:96vw;
  max-height:min(94dvh,865px); margin:auto; padding:7px 10px 11px;
  overflow:hidden; border:1px solid #47446e!important; border-radius:22px;
  color:#f4efff; background:radial-gradient(ellipse at 48% -15%,#2d225c,transparent 58%),linear-gradient(180deg,#0d0a29,#080a21 76%)!important;
  box-shadow:0 12px 58px #020111cc, 0 0 20px #6545a94d!important;
}
#dlgTL[open] {display:flex;flex-direction:column;}
#dlgTL::before {
  content:""; position:absolute; inset:0; border:solid transparent;
  border-image:url('../quests/frame.webp') 30 41 35 41 / 13px 15px 15px stretch;
  z-index:3; pointer-events:none; border-radius:inherit;
}
#dlgTL .dlgHead {
  flex:none; position:relative; isolation:isolate; display:flex; align-items:center;
  gap:14px;min-height:84px;box-sizing:border-box;padding:8px 21px 9px 110px;
  border-bottom:1px solid #8a6984; border-radius:14px 14px 0 0;
  background:linear-gradient(90deg,#21142a,#120c27);
}
#dlgTL .dlgHead::after {
  content:""; position:absolute; inset:0 0 0 auto;z-index:-1;
  width:67%;pointer-events:none;opacity:.76;
  background:url('../quests/galaxy.webp') center / cover no-repeat;
  mask-image:linear-gradient(90deg,transparent 1%,#000 35%,#000);
}
#dlgTL .dlgHead::before {
  content:"";position:absolute;inset:3px auto 4px 21px;width:78px;
  background:url('../master-trophy.webp') center/contain no-repeat;pointer-events:none;
  filter:drop-shadow(0 3px 4px #090414);
}
#dlgTL .dlgHead h2 {
  margin:0;color:#ffdfa0;font:700 clamp(25px,3.2vw,41px)/1.14 var(--tl-title);
  text-shadow:0 2px 3px #241020;
}
#dlgTL .dlgHead h2::after {display:block;content:"";height:1px;margin-top:5px;background:linear-gradient(90deg,#ffe5a0,#f6ae45 30%,transparent 93%);}
#dlgTL .iconbtn {margin-inline-start:auto;flex:none;min-height:42px;padding:5px 16px;border-radius:22px;}
#dlgTL .wBody {
  display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0!important;gap:0;max-height:none;
}
#dlgTL .tlNav {
  flex:none;display:grid;gap:10px;padding:12px 14px 14px;
  background:radial-gradient(ellipse at top,#26204d,transparent 86%);border-bottom:1px solid #302044;
}
#dlgTL .tlList {
  display:grid;flex:1 1 auto;min-height:0;grid-template-columns:minmax(0,1fr);
  grid-auto-rows:max-content;align-content:start;gap:12px;overflow:auto;overscroll-behavior:contain;
  padding:0 13px 10px;scrollbar-width:thin;scrollbar-color:#786590 #0c0a23;
}
#dlgTL .tlHead {display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin:0;padding:0;}
#dlgTL .tlHead > span {
  display:inline-flex;align-items:center;gap:5px;min-height:30px;box-sizing:border-box;
  padding:4px 12px;border:1px solid #9d7c535e;border-radius:18px;color:#f3e5c9;
  background:linear-gradient(#20203d,#0d1025); font-size:13px;line-height:1.2;
}
#dlgTL .tlHead b {color:#ffe098;font-variant-numeric:tabular-nums;}
#dlgTL .slTabs {display:grid;grid-template-columns:1fr 1.18fr 1fr;gap:7px; margin:0;}
#dlgTL .slTabs .btn {
  margin:0;min-width:0;min-height:44px;padding:6px 8px; white-space:normal;border:1px solid #5c7cba;
  border-radius:12px;background:linear-gradient(#283260,#111a36 60%,#152841);color:#d8e5ff;
  box-shadow:inset 0 1px 0 #b6d6ff42; font:700 16px/1.12 var(--tl-title);
}
#dlgTL .slTabs .btn[aria-pressed="true"] {
  border-color:#f4c479;color:#fff0be;background:linear-gradient(160deg,#795020,#402214 62%,#28192c);
  box-shadow:inset 0 1px 2px #fff0bc9c,0 0 11px #ffc25335;
}
#dlgTL .tlCard,#dlgTL .tlB {
  --accent:#c09aff; --wash:#392251; position:relative; isolation:isolate;
  box-sizing:border-box;border:1px solid color-mix(in srgb,var(--accent),#222643 46%);
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--accent),transparent 55%),0 4px 10px #03071775;
  background:linear-gradient(112deg,var(--wash),#10162f 46%,#101328 84%,color-mix(in srgb,var(--wash),#0c1022 62%));
  border-radius:15px;
}
#dlgTL .tlCard {
  display:grid;grid-template-columns:clamp(110px,16vw,155px) minmax(0,1fr) minmax(107px,max-content);
  align-items:center;gap:13px; padding:9px 16px 9px 8px;min-height:116px;
}
#dlgTL .tlCard::before,#dlgTL .tlB::before {
  position:absolute;inset:0;z-index:-1;content:"";pointer-events:none;border-radius:inherit;
  background:linear-gradient(90deg,transparent 0%,#10162fca 52%,#101328c9),url('../quests/rocky-horizon.webp') left 60%/cover no-repeat;
  opacity:.42;
}
#dlgTL .tlCard::after,#dlgTL .tlB::after {
  position:absolute;top:0;left:14%;right:12%;height:1px;content:"";pointer-events:none;
  background:linear-gradient(90deg,transparent,var(--accent),transparent);
}
#dlgTL [data-art="cup"],#dlgTL [data-art="schedule"] {--accent:#75d7fa;--wash:#172f50;}
#dlgTL .tlCard[data-metal] {
  --accent:#70bcdd; border-color:#497e9c;
  background:#10132b; box-shadow:inset 0 0 0 1px #112c48,0 3px 6px #03051788;
}
#dlgTL .tlCard[data-metal]::before {
  opacity:1;
  background:linear-gradient(90deg,#172e4a55,#161a33eb 40%,#10142beb 75%,#10132a9e),
    url('../quests/rocky-horizon.webp') center 77% / cover no-repeat;
}
#dlgTL .tlCard[data-metal] .tlIco {
  mask-image:none; background:none; display:grid; place-items:center;
}
#dlgTL .tlCard[data-metal] .tlIco::before {
  content:"";width:100%;height:100%;
  background:url('../master-trophy.webp') center/contain no-repeat;
  filter:var(--metal-finish,drop-shadow(0 2px 3px #0e081a));
}
#dlgTL [data-metal="bronze"] {--metal-finish:sepia(.70) saturate(1.7) hue-rotate(335deg) brightness(.92) drop-shadow(0 1px 3px #1a0c18);}
#dlgTL [data-metal="silver"] {--metal-finish:grayscale(1) contrast(.96) brightness(1.22) drop-shadow(0 0 3px #c4dcff44);}
#dlgTL [data-metal="diamond"] {--metal-finish:grayscale(1) sepia(.5) saturate(2.4) hue-rotate(158deg) brightness(1.37) drop-shadow(0 0 3px #8adfff);}
#dlgTL [data-metal="diamond"] .tlIco::after {
  content:"";position:absolute;width:74px;height:100%;pointer-events:none;
  background:radial-gradient(ellipse 4px 1px at 11% 22%,white,transparent),radial-gradient(ellipse 1px 5px at 11% 22%,white,transparent),
    radial-gradient(ellipse 5px 1px at 86% 11%,white,transparent),radial-gradient(ellipse 1px 5px at 86% 11%,white,transparent);
}
#dlgTL [data-art="online"],#dlgTL [data-art="sh"] {--accent:#70e4d9;--wash:#193c4b;}
#dlgTL .tlCard[data-metal] .tlIco {height:91px;}
#dlgTL .tlIco {
  position:relative;box-sizing:border-box;width:100%;height:88px;border:0;border-radius:0;box-shadow:none;
  background:var(--emblem) center / contain no-repeat;
  mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);
}
#dlgTL [data-art="battle"] .tlIco,#dlgTL [data-art="xp"] .tlIco,#dlgTL [data-art="sh"] .tlIco,#dlgTL [data-art="online"] .tlIco,#dlgTL [data-art="schedule"] .tlIco {
  background:var(--emblem) center / cover no-repeat;
  mask-image:radial-gradient(ellipse closest-side,#000 65%,#0008 88%,transparent 100%);
}
#dlgTL [data-art="battle"] {--emblem:url('../achievement-icons/short_win.png');}
#dlgTL [data-art="cup"] {--emblem:url('../master-trophy.webp');}
#dlgTL [data-art="online"] {--emblem:url('online-globe.webp');}
#dlgTL [data-art="schedule"] {--emblem:url('calendar-glass.webp');}
#dlgTL [data-art="xp"] {--emblem:url('../currency/xp-star.webp');}
#dlgTL [data-art="sh"] {--emblem:url('../achievement-icons/short10.png');}
#dlgTL .tlInfo {gap:7px;}
#dlgTL .tlInfo > b,#dlgTL .tlB > b {
  color:#ffe1a5;font:700 clamp(20px,2.2vw,28px)/1.12 var(--tl-title);text-shadow:0 2px 2px #100719;
}
#dlgTL .tlInfo small,#dlgTL .tlB small,#dlgTL .tlAct small {
  opacity:1;color:#e2dfed;font-size:14px;line-height:1.45;overflow-wrap:break-word;
}
#dlgTL .tlInfo small b,#dlgTL .tlBv b {font:inherit;font-weight:700;color:#fff1c5;}
#dlgTL .tlLadder {display:flex;flex-wrap:wrap;align-items:center;gap:4px;}
#dlgTL .tlLadder > span,#dlgTL .tlBv {
  display:inline-flex;align-items:center;gap:3px;color:#eeecff;background:#0b1229bd;border:1px solid #697da35e;
  padding:3px 7px;border-radius:7px;font:600 12px/1.2 "Golos Text",sans-serif;
}
#dlgTL .tlLadder > .on {color:#b5ffe0;border-color:#70d6aa;background:#14382e;}
#dlgTL .tlLadder .tlStep {padding:3px 4px;gap:4px;border-color:#8a6c9b70;}
#dlgTL .tlStep > b {color:#c7b5df;font:600 10px/1.25 "Golos Text",sans-serif;border-inline-end:1px solid #9d89bf6b;padding-inline-end:4px;}
#dlgTL .tlAmount,#dlgTL .tlPlus {background:none;padding:0;border:0;color:inherit;display:inline-flex;align-items:center;gap:2px;font:inherit;}
#dlgTL .tlUnit {display:inline-block;width:14px;height:14px;vertical-align:-2px;background-position:center;background-repeat:no-repeat;background-size:contain;}
#dlgTL .tlUnit.coin {background-image:url('../calendar/coin.webp');border-radius:50%;}
#dlgTL .tlUnit.bar {background-image:url('../currency/vip-ingot.webp');}
#dlgTL .tlUnit.gem {background-image:url('../calendar/diamond.webp');}
#dlgTL .tlUnit.box {background-image:url('../calendar/gift.webp');}
#dlgTL .tlAct {display:flex;grid-column:auto;flex-direction:column;gap:7px;align-items:stretch;}
#dlgTL .tlAct .btn,#dlgTL .aoBtns .btn {
  min-height:42px;min-width:0;margin:0;padding:7px 14px;white-space:normal;line-height:1.17;
  color:#dff6ff;border-radius:12px;border:1px solid #6894bf;
  background:linear-gradient(#263e64,#14213e 55%,#182640);box-shadow:inset 0 1px 0 #d8eaff4d;
}
#dlgTL .tlAct .primary,#dlgTL .aoBtns .primary {
  color:#2e1604;border-color:#ffeea2;
  background:linear-gradient(#fff1ad,#ffd15e 46%,#e6a036 52%,#e9ac48 88%,#ffe798);
  box-shadow:0 1px 3px #0008,inset 0 0 0 2px #aa671e,0 0 10px #ffc25830;
}
#dlgTL .tlAct :disabled,#dlgTL .aoBtns :disabled {
  color:#b8b8c4;border-color:#666271;background:linear-gradient(#393747,#222335);opacity:1;box-shadow:none;cursor:not-allowed;
}
#dlgTL button:focus-visible {outline:2px solid #a6f4ff;outline-offset:2px;}
@media(hover:hover) {
  #dlgTL button:not(:disabled):hover {filter:brightness(1.13);}
}
#dlgTL .tlBoost {gap:12px;grid-template-columns:repeat(2,minmax(0,1fr));}
#dlgTL .tlB {padding:12px;gap:8px;}
#dlgTL .tlB .tlIco {width:120px;height:64px;}
#dlgTL .tlB .aoBtns {display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:auto;}
#dlgTL .tlTop,#dlgTL .note {margin:0; border-radius:10px; padding:10px 13px;border:1px solid #8e79524d;background:#10132ce6;color:#d8d9e8;}
#dlgTL .note {font-size:13px;line-height:1.45;border-inline-start:2px solid #c0a468;}
#dlgTL .tlTop > b {color:#ffdfa0;}
@media(max-width:700px){
  #dlgTL .tlCard {grid-template-columns:86px minmax(0,1fr) minmax(89px,max-content);gap:9px;padding:12px;}
  #dlgTL .tlAct .btn {padding-inline:8px;}
}
@media(max-width:540px){
  #dlgTL {width:97vw;max-width:97vw;max-height:95dvh;border-radius:18px;}
  #dlgTL::before {border-image-width:8px 8px 9px;}
  #dlgTL .dlgHead {min-height:76px;padding:9px 12px 9px 64px;gap:6px;}
  #dlgTL .dlgHead::before {left:9px;width:52px;}
  #dlgTL .dlgHead h2 {font-size:clamp(19px,5.4vw,27px);}
  #dlgTL .iconbtn {padding:6px 9px;font-size:12px;}
  #dlgTL {padding:5px 5px 8px;}
  #dlgTL .dlgHead {padding-left:63px;}
  #dlgTL .tlNav {padding:6px 5px 8px;gap:6px;}
  #dlgTL .tlList {padding:0 5px 6px;gap:7px;}
  #dlgTL .tlHead {gap:4px;}
  #dlgTL .tlHead > span {padding:4px 7px;font-size:12px;gap:2px;}
  #dlgTL .slTabs {gap:4px;margin-bottom:1px;}
  #dlgTL .slTabs .btn {font-size:14px;padding:5px 3px;}
  #dlgTL .tlCard {grid-template-columns:66px minmax(0,1fr);gap:7px 10px;padding:11px;}
  #dlgTL .tlCard .tlIco,#dlgTL .tlCard[data-metal] .tlIco {width:100%;height:62px;}
  #dlgTL .tlCard[data-metal] {grid-template-columns:58px minmax(0,1fr);gap:4px 9px;padding:9px;min-height:100px;}
  #dlgTL [data-metal] .tlIco {grid-row:1/3;}
  #dlgTL [data-metal] .tlAct {grid-column:2;justify-content:flex-start;}
  #dlgTL [data-metal] .tlAct .btn {flex:0 1 auto;min-width:94px;min-height:44px;}
  #dlgTL [data-metal="diamond"] .tlIco::after {width:48px;}
  #dlgTL .tlInfo {gap:5px;}
  #dlgTL .tlInfo > b {font-size:21px;}
  #dlgTL .tlInfo small {font-size:13px;}
  #dlgTL .tlAct {grid-column:1/-1;flex-direction:row;justify-content:flex-end;flex-wrap:wrap;}
  #dlgTL .tlAct .btn {flex:1 1 90px;min-height:44px;max-width:100%;}
  #dlgTL .tlBoost {grid-template-columns:1fr;}
  #dlgTL .tlB {display:grid;grid-template-columns:66px minmax(0,1fr);text-align:left;justify-items:start;}
  #dlgTL .tlB .tlIco {width:66px;grid-column:1;grid-row:1/4;align-self:center;}
  #dlgTL .tlB > b,#dlgTL .tlB small,#dlgTL .tlBv {grid-column:2;}
  #dlgTL .tlB .aoBtns {grid-column:1/-1;width:100%;margin:0;}
  #dlgTL .tlB .aoBtns .btn {flex:1;min-height:44px;}
}
@media(max-height:480px){
  #dlgTL {max-height:97dvh;}
  #dlgTL .dlgHead {min-height:54px;padding:6px 18px 6px 73px!important;}
  #dlgTL .dlgHead::before {width:49px;left:14px;}
  #dlgTL .dlgHead h2 {font-size:24px!important;}
  #dlgTL .dlgHead h2::after {margin-top:2px;}
  #dlgTL .dlgHead .iconbtn {min-height:40px!important;}
}

@media(max-height:480px) {
  #dlgTL .tlNav {padding:4px 10px 6px;gap:3px;}
  #dlgTL .tlHead > span {min-height:22px;padding-block:2px;}
  #dlgTL .slTabs .btn {min-height:36px;}
  #dlgTL .tlList {gap:7px;}
}
@media(min-width:541px) {
  #dlgTL .tlCard[data-metal] {grid-template-columns:clamp(87px,14vw,157px) minmax(0,1fr) max-content;}
  #dlgTL [data-metal] .tlAct .btn {min-width:105px;}
}

@media(min-width:701px) and (min-height:481px) and (max-height:820px) {
  #dlgTL {width:clamp(700px,109dvh,890px);}
  #dlgTL .dlgHead {min-height:clamp(60px,10.4dvh,82px);padding-left:clamp(91px,14dvh,111px);}
  #dlgTL .dlgHead h2 {font-size:clamp(28px,5.1dvh,40px);}
  #dlgTL .dlgHead::before {width:clamp(54px,9dvh,74px);left:20px;}
  #dlgTL .tlNav {padding:8px 11px 11px;gap:7px;}
  #dlgTL .slTabs .btn {min-height:clamp(35px,5.5dvh,44px);}
  #dlgTL .tlList {gap:clamp(7px,1.45dvh,12px);}
  #dlgTL .tlCard[data-metal] {grid-template-columns:clamp(88px,19dvh,144px) minmax(0,1fr) max-content;min-height:clamp(72px,14.2dvh,116px);padding:6px 12px 6px 8px;gap:10px;}
  #dlgTL .tlCard[data-metal] .tlIco {height:clamp(58px,10.8dvh,87px);}
  #dlgTL .tlCard[data-metal] .tlInfo > b {font-size:clamp(22px,3.8dvh,28px);}
  #dlgTL .tlCard[data-metal] .tlInfo small {font-size:clamp(12px,1.8dvh,14px);}
  #dlgTL .tlCard[data-metal] .tlAct .btn {min-width:94px;}
}

/* Use the Friends invitation prize artwork for every ticket in this lobby. */
.gameTicket {
  display:inline-block; width:1.75em; height:1.23em;
  vertical-align:-.22em; max-width:none; object-fit:contain; pointer-events:none;
  mix-blend-mode:screen; mask-image:radial-gradient(ellipse 57% 60% at center,#000 72%,transparent);
}
#dlgTL .tlHead .gameTicket, #dlgTL [data-hb="tk"] .gameTicket {width:2em;height:1.4em;}

#btnLot .gameTicket, .vipList .gameTicket, .lotCall .gameTicket, .lotHead .gameTicket {width:1.75em;height:1.23em;vertical-align:-.22em;}

/* The two live-tournament entries share the wide, illustrated left panel. */
#dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) {
  --accent:#75c9e6; --wash:#171a39;
  border-color:#497e9c; overflow:hidden; padding-inline-start:0; column-gap:9px;
}
#dlgTL .tlCard:is([data-art="online"],[data-art="schedule"])::before {
  opacity:1;
  background:linear-gradient(90deg,#172e4a55,#161a33eb 40%,#10142beb 75%,#10132a9e),
    url('../quests/rocky-horizon.webp') center 77% / cover no-repeat;
}
#dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) .tlIco {
  align-self:stretch; height:auto; min-height:80px; margin-block:-9px;
  background:var(--emblem) left center / contain no-repeat;
  mask-image:linear-gradient(to right,#000 88%,transparent);
}
@media (min-width:541px) {
  #dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) {
    grid-template-columns:clamp(115px, 17vw, 165px) minmax(0,1fr) max-content;
  }
}
@media (max-width:540px) {
  #dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) {grid-template-columns:74px minmax(0,1fr);padding-block:10px;gap:6px 9px;}
  #dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) .tlIco {
    grid-row:1/3; margin:0; min-height:62px; align-self:center;
  }
  #dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) .tlAct {grid-column:2; justify-content:flex-start;}
  #dlgTL .tlCard:is([data-art="online"],[data-art="schedule"]) .tlAct button {flex:0 1 auto;min-width:96px;}
}
