/* The Rift, concept B: three tears in the night sky. The old board stays underneath, hidden, as the source of data and actions.
   Art: /v2/art/rift-tears/. Everything is sized from the panel with container queries, not the window. */
#panelTavern.rt-on{position:relative;overflow:hidden!important;padding:0!important}
/* One continuous night behind the panel and behind the navigation bar */
html.gv-v2 body #mainContent:has(#panelTavern.rt-on){background:#07040c url('/v2/art/rift-tears/land.webp') center/cover no-repeat!important}
html.gv-v2 body #panelTavern.gv-rift.rt-on{background:none!important}
#panelTavern.rt-on>:not(#rtView){display:none!important}
#rtView{--gold:#ffe2a0;--ink:#f4e8d5;--gl:1.9%;--gt:25%;--gw:96.2%;position:absolute!important;inset:0!important;width:auto!important;height:auto!important;overflow:hidden;container-type:size;container-name:rt;background:none;color:var(--ink);font-family:var(--font-body,system-ui,sans-serif);text-align:center}
#rtFx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#rtUi{position:absolute;inset:0;overflow:auto;display:flex;flex-direction:column;scrollbar-width:thin}
#rtModal{position:absolute;inset:0;pointer-events:none;z-index:5}

.rt-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:14px 26px 0;flex:none;text-align:left}
.rt-head h1{margin:0;font:700 40px/1.05 var(--font-display,serif);color:var(--gold);text-shadow:0 3px 10px #000c}
.rt-tag{margin:3px 0 0;font-size:15px;color:var(--ink);text-shadow:0 2px 6px #000d}
.rt-energy{display:flex;align-items:center;gap:12px;flex:0 1 620px;min-width:0}
.rt-crystal{width:62px;height:62px;object-fit:contain;flex:none;filter:drop-shadow(0 0 14px #6fc8ffaa);animation:rtCrystal 4s ease-in-out infinite}
@keyframes rtCrystal{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.rt-ebody{flex:1 1 auto;min-width:0}
.rt-etop{display:flex;justify-content:space-between;align-items:baseline;gap:8px;text-shadow:0 2px 6px #000d}
.rt-etop span{font:700 18px var(--font-display,serif);color:var(--gold)}
.rt-etop b{font:700 25px/1 var(--font-display,serif);color:#fff4dc;font-variant-numeric:tabular-nums}
.rt-etop small{font-size:16px;color:#d9c9b4}
.rt-gauge{position:relative;height:42px;background:url('/v2/art/rift-tears/energy-frame.webp') center/100% 100% no-repeat}
.rt-gauge i{position:absolute;left:var(--gl);top:var(--gt);bottom:var(--gt);border-radius:3px;background:linear-gradient(90deg,#2f8fff,#6fd0ff 60%,#d8f6ff);box-shadow:0 0 12px #5fc0ffcc;transition:width .7s cubic-bezier(.2,.8,.2,1);overflow:hidden}
.rt-gauge i:after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,#fff0 30%,#fff9 50%,#fff0 70%);transform:translateX(-100%);animation:rtSheen 3.6s ease-in-out infinite}
@keyframes rtSheen{60%,100%{transform:translateX(100%)}}
.rt-einfo{font-size:13px;color:#d9c9b4;text-shadow:0 2px 6px #000d;text-align:left}
.rt-refill{flex:none;min-width:190px;min-height:62px;padding:4px 30px;border:0;background:url('/v2/art/create-screen/begin-button.webp') center/100% 100% no-repeat;color:#2d1804;font:700 17px/1.05 var(--font-display,serif);cursor:pointer;transition:filter .18s,transform .18s;animation:rtCall 3.2s ease-in-out infinite}
.rt-refill:hover{transform:translateY(-1px);filter:brightness(1.12) drop-shadow(0 0 14px #ffc14daa)}
.rt-refill:disabled{animation:none;opacity:.5;cursor:default}
@keyframes rtCall{0%,100%{filter:drop-shadow(0 0 3px #ffc14d55)}50%{filter:drop-shadow(0 0 14px #ffc14dbb)}}

.rt-main{flex:1 1 auto;min-height:0;position:relative;display:flex;flex-direction:column}
.rt-grid{flex:1 0 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 10px;padding:0 3%}
.rt-m{all:unset;position:relative;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;text-align:center;cursor:pointer;min-width:0;transition:opacity .35s ease-out}
.rt-m .rt-win{flex:1 1 auto;width:100%;min-height:120px}
.rt-facts{flex:none;padding:6px 6px 8px;text-shadow:0 2px 8px #000,0 0 3px #000}
.rt-facts h2{margin:0;font:700 clamp(19px,2.3cqw,28px)/1.15 var(--font-display,serif);color:var(--gold)}
.rt-kind{font:700 12px var(--font-display,serif);letter-spacing:.14em;color:#e9c98a;margin:1px 0 4px;text-transform:uppercase}
.rt-facts p{margin:0;font-size:clamp(13px,1.25cqw,16px);line-height:1.5}
.rt-facts .rt-per{color:#d9c9b4;font-size:clamp(12px,1.05cqw,14px);margin-top:3px}
.rt-best{display:inline-block;font:italic 13px Georgia,serif;color:#f7c75f;margin-top:2px}
.rt-m:not(.on){opacity:.58}
.rt-m:hover{opacity:1}
.rt-m:focus-visible{outline:2px solid var(--gold);outline-offset:-4px}
.rt-ic{display:inline-flex;align-items:center;vertical-align:middle;gap:4px;white-space:nowrap}
.rt-ic img{width:1.3em;height:1.3em;object-fit:contain;filter:drop-shadow(0 1px 3px #000c)}
.rt-sep{margin:0 5px;opacity:.6}

.rt-tablet{flex:none;align-self:center;box-sizing:border-box;width:min(640px,94%);margin:2px auto 6px;padding:18px 44px 20px;background:url('/v2/art/rift-tears/tablet.webp') center/100% 100% no-repeat;filter:drop-shadow(0 12px 20px #000a)}
.rt-tablet p{margin:0 0 9px;font:16px/1.3 Georgia,serif}
.rt-go{display:block;box-sizing:border-box;width:min(320px,100%);min-height:60px;margin:0 auto;padding:6px 40px;border:0;background:url('/v2/art/create-screen/begin-button.webp') center/100% 100% no-repeat;color:#2d1804;font:700 22px/1.05 var(--font-display,serif);cursor:pointer;transition:filter .18s}
.rt-go:hover:not(:disabled){filter:brightness(1.1) drop-shadow(0 0 12px #ffc14d99)}
.rt-go:disabled{filter:saturate(.4);opacity:.65;cursor:default}
.rt-fresh{flex:none;font-size:13px;color:#d9c9b4;margin-bottom:8px;text-shadow:0 2px 6px #000d}

.rt-run{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:18% minmax(0,1fr) 18%;grid-template-rows:minmax(0,1fr) auto;padding:0 3%}
.rt-run .rt-win{height:100%;min-height:100px}
.rt-run .rt-centre{grid-column:2;grid-row:1}
.rt-info{grid-column:1/-1;grid-row:2;padding:4px 10px 10px;text-shadow:0 2px 8px #000,0 0 3px #000;animation:rtIn .45s ease-out both}
@keyframes rtIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.rt-info h2{margin:0;font:700 30px/1.1 var(--font-display,serif);color:var(--gold)}
.rt-st{font:italic 16px Georgia,serif;color:#e9c98a}
.rt-clock{font:700 clamp(46px,7cqw,82px)/1.05 var(--font-display,serif);color:#ffd98a;text-shadow:0 0 22px #ffb84d88,0 3px 8px #000;font-variant-numeric:tabular-nums}
.rt-rw{display:flex;justify-content:center;flex-wrap:wrap;gap:2px 20px;font-size:17px;margin:2px 0 10px}
.rt-acts{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap}
.rt-acts .rt-go{margin:0}
.rt-go img{width:22px;height:22px;object-fit:contain;vertical-align:-4px;margin-right:6px}
.rt-ghost{min-height:48px;padding:6px 22px;border:1px solid #d8ad62;border-radius:999px;background:#0e0916b3;color:var(--gold);font:700 15px var(--font-display,serif);cursor:pointer}
.rt-ghost:hover{background:#2a1c34}

/* Windows */
.rt-veil{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:12px;background:#05030aa8;backdrop-filter:blur(3px);pointer-events:auto;animation:rtFade .22s ease-out both}
@keyframes rtFade{from{opacity:0}to{opacity:1}}
.rt-veil.out{animation:rtOut .2s ease-in both}
@keyframes rtOut{to{opacity:0}}
.rt-frame{position:relative;isolation:isolate;box-sizing:border-box;width:min(640px,100%);max-height:100%;overflow:auto;padding:46px 58px 40px;animation:rtRise .42s cubic-bezier(.16,1,.3,1) both}
.rt-frame:before{content:"";position:absolute;inset:0;z-index:-1;border-style:solid;border-color:transparent;border-width:36px 24px 26px;border-image:url('/v2/art/rift-tears/window.webp') 46 30 34 fill / 36px 24px 26px / 0 stretch;filter:drop-shadow(0 20px 40px #000c)}
@keyframes rtRise{from{opacity:0;transform:translateY(26px) scale(.95)}to{opacity:1;transform:none}}
.rt-x{position:absolute;top:18px;right:22px;width:40px;height:40px;border:1px solid #d8ad62;border-radius:50%;background:#0b0712cc;color:var(--gold);font-size:18px;cursor:pointer}
.rt-frame h2{margin:0;font:700 clamp(25px,4cqw,34px)/1.12 var(--font-display,serif);color:var(--gold);text-shadow:0 0 16px #ffc14d55}
.rt-sub{margin:3px 0 12px;font:italic 15px Georgia,serif;color:#e0cfb4}
.rt-frame .rt-gauge{height:50px;margin:2px 0}
.rt-big{font:700 34px/1 var(--font-display,serif);color:#fff4dc;font-variant-numeric:tabular-nums;margin-top:4px}
.rt-big small{font-size:20px;color:#d9c9b4}
.rt-opts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:14px}
.rt-opt img.rt-hero{display:block;height:84px;margin:0 auto 2px;object-fit:contain;filter:drop-shadow(0 6px 10px #000a)}
.rt-opt h3{margin:0;font:700 21px var(--font-display,serif);color:var(--gold)}
.rt-left{font-size:13px;color:#d9c9b4;margin-bottom:8px}
.rt-buy{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 8px;box-sizing:border-box;width:100%;min-height:50px;margin-top:7px;padding:4px 12px;border:1px solid #d8ad62;border-radius:8px;background:#0e0916cc;color:#fff4dc;font:700 17px var(--font-display,serif);cursor:pointer;transition:background .15s,transform .12s}
.rt-buy:hover:not(:disabled){background:#2a1c34}
.rt-buy:active:not(:disabled){transform:scale(.97)}
.rt-buy:disabled{opacity:.42;cursor:default}
.rt-buy img{width:22px;height:22px;object-fit:contain}
.rt-buy.max{background:linear-gradient(#3a2a12cc,#20160bcc);border-color:#ffd98a}
.rt-spk{position:absolute;width:6px;height:6px;border-radius:50%;background:#bfe8ff;box-shadow:0 0 10px #7fd0ff;pointer-events:none;animation:rtSpk .75s ease-out forwards;z-index:9}
@keyframes rtSpk{to{transform:translate(var(--dx),var(--dy)) scale(.2);opacity:0}}

/* The game's own reward popup, dressed for the Rift */
#gvRewardPopup:has(.rp-crest[data-crest="breach"]){border-image:none!important;position:fixed;left:50%;top:50%;right:auto;bottom:auto;box-sizing:border-box;width:min(600px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;padding:46px 54px 38px!important;background:none!important;border:0!important;border-radius:0;box-shadow:0 0 0 100vmax #05030aa8;text-align:center;transform:translate(-50%,-46%) scale(.95);opacity:0;transition:opacity .25s ease-out,transform .42s cubic-bezier(.16,1,.3,1);isolation:isolate}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]).show{transform:translate(-50%,-50%);opacity:1}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]):before{content:""!important;position:absolute!important;inset:0!important;z-index:-1;display:block!important;border-style:solid;border-color:transparent;border-width:36px 24px 26px;border-image:url('/v2/art/rift-tears/window.webp') 46 30 34 fill / 36px 24px 26px / 0 stretch;background:none}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]):after{display:none!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"])>:not(.rp-title,.rp-rewards,.rp-actions){display:none!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]){outline:0!important;filter:none!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-crest{display:none!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-title{margin:0 0 14px;font:700 32px/1.12 var(--font-display,serif);color:#ffe2a0;text-shadow:0 0 16px #ffc14d55}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-rewards{display:flex;flex-wrap:wrap;justify-content:center;gap:12px 26px;margin:6px 0 18px}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip{display:flex;flex-direction:column;align-items:center;width:124px;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;animation:rtPop .5s cubic-bezier(.2,1.4,.4,1) both}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip:nth-child(2){animation-delay:.17s}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip:nth-child(3){animation-delay:.34s}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip:nth-child(4){animation-delay:.51s}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip:nth-child(5){animation-delay:.68s}
@keyframes rtPop{from{opacity:0;transform:translateY(16px) scale(.7)}to{opacity:1;transform:none}}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip img{width:74px;height:74px;object-fit:contain;filter:drop-shadow(0 0 12px #ffd98a66)}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-amt{font:700 26px/1.1 var(--font-display,serif);color:#fff4dc}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-name{font-size:14px;color:#e0cfb4}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-actions{display:flex;justify-content:center;align-items:center;gap:12px}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-btn{border:0!important;border-image:none!important;background:none!important;box-shadow:none!important;color:#d9c9b4!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-btn.primary{box-sizing:border-box;min-width:260px;min-height:60px;padding:6px 40px;background:url('/v2/art/create-screen/begin-button.webp') center/100% 100% no-repeat!important;color:#2d1804!important;font:700 21px/1.05 var(--font-display,serif)}

/* Mission finished while the player is elsewhere */
.rt-ntc{position:fixed;top:12px;left:50%;z-index:9000;display:flex;align-items:center;gap:14px;box-sizing:border-box;width:min(620px,calc(100vw - 16px));min-height:86px;padding:8px 22px 8px 16px;transform:translate(-50%,-160%);transition:transform .5s cubic-bezier(.16,1,.3,1);background:url('/v2/art/rift-tears/notice.webp') center/100% 100% no-repeat;filter:drop-shadow(0 12px 22px #000c);color:#f4e8d5}
.rt-ntc.in{transform:translate(-50%,0)}
.rt-ntc-win{flex:none;width:58px;height:66px;background-size:cover;background-position:center;clip-path:polygon(44% 0,62% 13%,56% 26%,78% 40%,70% 56%,88% 74%,58% 82%,52% 100%,32% 84%,14% 78%,24% 58%,10% 42%,30% 28%,24% 12%);filter:drop-shadow(0 0 8px #ffd98a)}
.rt-ntc-t{flex:1 1 auto;min-width:0;text-align:left}
.rt-ntc-t b{display:block;font:700 19px/1.15 var(--font-display,serif);color:#ffe2a0}
.rt-ntc-t span{font-size:14px}
.rt-ntc .rt-go{flex:none;width:auto;min-width:130px;min-height:50px;padding:4px 26px;margin:0;font-size:17px}
.rt-ntc-x{flex:none;width:30px;height:30px;border:0;background:none;color:#d9c9b4;font-size:17px;cursor:pointer}
@media(max-width:560px){.rt-ntc{min-height:72px;padding:6px 10px;gap:8px}.rt-ntc-t b{font-size:15px}.rt-ntc-t span{font-size:12px}.rt-ntc .rt-go{min-width:88px;min-height:42px;padding:3px 12px;font-size:14px}
 #gvRewardPopup:has(.rp-crest[data-crest="breach"]){padding:34px 28px 26px}
 #gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip{width:92px}
 #gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip img{width:56px;height:56px}
 #gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-title{font-size:25px}
 #gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-btn.primary{min-width:200px;min-height:54px;font-size:18px}
}

@container rt (max-width:760px){
 .rt-head{padding:8px 12px 0;flex-wrap:wrap}
 .rt-head h1{font-size:28px}
 .rt-tag{font-size:13px}
 .rt-energy{flex:1 1 100%;gap:8px}
 .rt-crystal{width:46px;height:46px}
 .rt-etop span{font-size:15px}.rt-etop b{font-size:20px}
 .rt-gauge{height:30px}
 .rt-refill{min-width:112px;min-height:52px;padding:3px 16px;font-size:13px}
 .rt-grid{flex:none;grid-template-columns:minmax(0,1fr);padding:4px 8px 0;gap:0}
 .rt-grid .rt-m{flex-direction:row;text-align:left;min-height:118px}
 .rt-grid .rt-m .rt-win{flex:0 0 40%;min-height:118px}
 .rt-grid .rt-facts{flex:1;align-self:center;padding:4px 2px 4px 8px}
 .rt-tablet{padding:14px 30px 16px}
 .rt-tablet p{font-size:15px}
 .rt-go{min-height:54px;font-size:19px}
 .rt-run{grid-template-columns:12% minmax(0,1fr) 12%;grid-template-rows:minmax(220px,1fr) auto}
 .rt-info h2{font-size:24px}
 .rt-frame{padding:34px 30px 28px}
 .rt-opts{gap:10px}
 .rt-opt img.rt-hero{height:60px}
 .rt-buy{font-size:15px;min-height:46px}
}
@container rt (max-height:620px) and (min-width:761px){
 .rt-head{padding-top:8px}
 .rt-head h1{font-size:30px}
 .rt-tag{display:none}
 .rt-crystal{width:44px;height:44px}
 .rt-gauge{height:28px}
 .rt-etop span{font-size:15px}.rt-etop b{font-size:20px}
 .rt-refill{min-height:50px;font-size:15px}
 .rt-m .rt-win{min-height:96px}
 .rt-facts{padding:2px 4px 4px}
 .rt-facts h2{font-size:18px}
 .rt-kind{margin:0 0 1px;font-size:11px}
 .rt-facts p{font-size:12px;line-height:1.35}
 .rt-facts .rt-per{font-size:11px;margin-top:0}
 .rt-best{font-size:11px;margin:0}
 .rt-tablet{display:flex;align-items:center;gap:16px;width:min(760px,96%);padding:9px 34px 10px;margin-bottom:2px}
 .rt-tablet p{flex:1 1 auto;margin:0;font-size:14px;text-align:left}
 .rt-tablet .rt-go{flex:none;width:190px;min-height:48px;padding:4px 26px;font-size:18px;margin:0}
 .rt-fresh{margin-bottom:3px;font-size:12px}
 .rt-run{grid-template-rows:minmax(110px,1fr) auto}
 .rt-info{padding:0 10px 4px}
 .rt-info h2{font-size:22px}
 .rt-st{font-size:13px}
 .rt-clock{font-size:40px}
 .rt-rw{font-size:14px;margin:0 0 5px}
 .rt-acts .rt-go{min-height:48px;font-size:17px}
}
@container rt (max-width:400px){
 .rt-refill{min-width:92px;padding:3px 10px;font-size:12px}
 .rt-etop span{font-size:13px}.rt-etop b{font-size:17px}.rt-etop small{font-size:13px}
 .rt-ic{white-space:normal}
 .rt-facts h2,.rt-facts p{overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){.rt-crystal,.rt-refill,.rt-gauge i:after{animation:none}.rt-frame,.rt-veil,.rt-info{animation-duration:.01s}}

/* "Rift Cleared!" (Mark, 11.11.2026: "wyglada zle i nie symetrycznie"): the rewards sat at the left of their row and
   "Close" stood beside the gold button as loose text. Rewards are centred on the window's axis, the gold button
   is centred and "Close" sits centred under it as a quiet link. */
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-rewards{display:flex!important;justify-content:center!important;align-self:stretch;width:100%;margin-left:0!important;margin-right:0!important;padding:0!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-chip{flex:0 0 auto;margin:0!important}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-actions{flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:4px!important;width:100%}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-btn:not(.primary){min-height:40px;padding:8px 22px!important;font:600 14px/1 var(--font-body,inherit)!important;letter-spacing:.06em;text-transform:uppercase;color:#bfae93!important;cursor:pointer}
#gvRewardPopup:has(.rp-crest[data-crest="breach"]) .rp-btn:not(.primary):hover{color:#ffe2a0!important}
