/* Landing, leaderboard and rewards screens (specs 01 and 02). The main column
   is 1040 wide inside 32px padding. */
.screen > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.gold { color: var(--gold); }
.coinline { display: inline-flex; align-items: center; gap: 8px; }
.coinline.gold { color: var(--gold); }

/* ---- carousel ---- */
.carousel { position: relative; margin-top: 0; }
.carousel__frame {
  position: relative; overflow: visible; aspect-ratio: 1040 / 173.39; padding: 2px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(to bottom, #3d3d3d, #8a6e1f);
}
.carousel__track { position: relative; width: 100%; height: 100%; border-radius: 10px; overflow: hidden; background: #141414; }
.carousel__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.6s, visibility 0.6s; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel__slide.is-on { opacity: 1; visibility: visible; z-index: 1; }
.carousel__slide.is-on.from-right { animation: slide-r 0.7s var(--ease-out); }
.carousel__slide.is-on.from-left { animation: slide-l 0.7s var(--ease-out); }
.carousel__slide.is-out { visibility: visible; }
@keyframes slide-r { from { transform: translateX(6%); opacity: 0; } }
@keyframes slide-l { from { transform: translateX(-6%); opacity: 0; } }
.carousel__slide.is-on > img { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.04); } }
.slide-art { position: relative; height: 100%; display: flex; align-items: center; padding: 0 8%; background: center / 100% 100% no-repeat; }
.slide-art__text h3 { margin: 0; font: 700 clamp(22px, 3vw, 32px)/1.4 var(--f-head); text-transform: uppercase; }
.slide-art__text h3.thin { font-weight: 400; font-size: clamp(26px, 3.4vw, 40px); }
.slide-art__text p { margin: 4px 0 0; font-size: clamp(13px, 1.4vw, 18px); color: #ffffff; max-width: 420px; }
.slide-art__img { position: absolute; right: 6%; top: 50%; height: 88%; width: auto; transform: translateY(-50%); }
.carousel__slide.is-on .slide-art__img { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(calc(-50% - 6px)); } }
.carousel__dots { position: absolute; z-index: 5; left: 50%; bottom: -20px; display: flex; gap: 6px; transform: translateX(-50%); }
.carousel__dots button { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.35); transition: width 0.3s var(--ease-out), background 0.3s; }
.carousel__dots button.is-on { width: 22px; background: var(--gold); }
.carousel__arrow {
  position: absolute; z-index: 3; top: 50%; width: 40px; height: 40px; margin-top: -20px;
  display: grid; place-items: center;
  background: #ffc239 url("../assets/ui/button-stripes.jpg") left center / auto 100%;
  transition: transform 0.2s var(--ease-back), box-shadow 0.2s;
}
.carousel__arrow--prev { left: -24px; }
.carousel__arrow--next { right: -24px; }
.carousel__arrow--next img { transform: rotate(180deg); }
.carousel__arrow:hover { transform: scale(1.1); box-shadow: 0 0 16px rgba(255, 194, 57, 0.45); }
.carousel__arrow--prev:hover img { animation: nudge-l 0.6s ease-in-out infinite; }
.carousel__arrow--next:hover img { animation: nudge-r 0.6s ease-in-out infinite; }
@keyframes nudge-l { 50% { transform: translateX(-3px); } }
@keyframes nudge-r { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(180deg) translateX(-3px); } }
.snowcap { position: absolute; z-index: 4; pointer-events: none; height: auto; }
.snowcap--tl { left: calc(16 / 1040 * 100%); top: -24px; width: calc(338 / 1040 * 100%); }
.snowcap--tr { left: calc(856 / 1040 * 100%); top: -24px; width: calc(152 / 1040 * 100%); }
.snowcap--bl { left: 0; bottom: -24px; width: calc(145 / 1040 * 100%); }
.snowcap--br { right: 0; bottom: -27px; width: calc(204 / 1040 * 100%); }

/* ---- game tiles: 4 then 3, 12px gaps, 2px inset ---- */
.tiles { margin-top: 34px; padding: 2px; display: flex; flex-direction: column; gap: 12px; perspective: 900px; }
.tiles__row { display: grid; gap: 12px; }
.tiles__row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  position: relative; display: block; aspect-ratio: 500 / 325;
  transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateZ(0);
  transition: transform 0.35s var(--ease-out), filter 0.3s, opacity 0.6s var(--ease-out);
}
.tile[data-reveal] { transform: translateY(18px); }
.tile[data-reveal].is-in { transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); }
.tile__img { position: absolute; inset: 0; overflow: hidden; border-radius: 2px; }
.tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.tile__img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) 0%, rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.tile:hover { filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(255, 199, 1, 0.15)); z-index: 1; }
.tile:hover .tile__img img { transform: scale(1.06); }
.tile:hover .tile__img::after { opacity: 1; }
.tile__snow { position: absolute; z-index: 2; height: auto; pointer-events: none; }
.tile--plinko .tile__snow { left: calc(96 / 250 * 100%); top: -16px; width: calc(118 / 250 * 100%); }
.tile--mines .tile__snow { left: calc(168 / 250 * 100%); top: -16px; width: calc(58 / 250 * 100%); }
.tile--coinflip .tile__snow { right: 0; top: -14px; width: calc(54 / 337 * 100%); }

/* ---- title between two fading rules (LEADERBOARD, OPEN CASES) ---- */
.title-rule { display: flex; align-items: center; gap: 40px; }
.title-rule span { flex: 1; height: 2px; background: linear-gradient(to left, #5a5a5a, rgba(56, 56, 56, 0) 98.2%); }
.title-rule span:last-child { background: linear-gradient(to right, #5a5a5a, rgba(56, 56, 56, 0) 98.2%); }
.title-rule h2 { margin: 0; font: 600 40px/60px var(--f-head); letter-spacing: 1px; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.title-rule--white h2 { color: #ffffff; }
.title-rule.is-in span { animation: rule-grow 0.9s var(--ease-out); }
@keyframes rule-grow { from { transform: scaleX(0); } }
.title-rule.is-in span:first-child { transform-origin: right; }
.title-rule.is-in span:last-child { transform-origin: left; }

/* ---- leaderboard ---- */
.lb { margin-top: 96px; }
.lb__bar { position: relative; display: flex; justify-content: center; margin-top: 28px; min-height: 49px; }
.lb__tabs { gap: 12px; align-self: flex-start; }
.lb__tabs .tab { width: 80px; padding: 6px 0; }
.tab--gold.is-on { color: #1d1d1d; background: #383838 url("../assets/ui/button-stripes.jpg") left center / auto 100%; }
.lb__timer { position: absolute; right: 0; top: -16px; display: flex; flex-direction: column; align-items: flex-end; }
.lb__timer small { font-size: 12px; line-height: 21px; color: var(--muted-2); }
.lb__timer > span { display: flex; align-items: center; gap: 6px; }
.lb__timer b { font: 700 16px/24px var(--f-head); color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lb__clock { margin-right: -24px; }
.lb__ring { width: 14px; height: 14px; transform: rotate(-90deg); }
.lb__ring circle { fill: none; stroke: #9a9a9a; stroke-width: 2; stroke-dasharray: 37.7; transition: stroke-dashoffset 1s linear; }
.lb__body { margin-top: 40px; }
.lb__body.is-swap { animation: panel-in 0.4s var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.podium__p { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.podium__p > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.podium__p small { color: var(--muted-2); font-size: 12px; }
.lb-ava { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(#ffe4ba, #e3983e); }
.podium__p--2 .lb-ava { background: linear-gradient(#e2e8f0, #787878); }
.podium__p--3 .lb-ava { background: linear-gradient(#a1745c, #5e3a2d); }
.lb-ava img { width: 48px; height: 48px; border: 3px solid var(--bg); border-radius: 50%; object-fit: cover; }
.podium__p--1 .lb-ava { width: 72px; height: 72px; animation: crown 3s ease-in-out infinite; }
.podium__p--1 .lb-ava img { width: 64px; height: 64px; }
@keyframes crown { 50% { box-shadow: 0 0 24px rgba(255, 199, 1, 0.45); } }
.podium__step {
  width: 100%; margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  background: linear-gradient(195.24deg, rgba(18, 18, 18, 0.5), rgba(18, 18, 18, 0)), #232323;
  border: 2px solid var(--line); border-radius: 4px 4px 0 0;
  transform-origin: bottom; animation: step-up 0.8s var(--ease-back) backwards;
}
.podium__step strong { font: 700 28px/1 var(--f-head); color: var(--muted-2); }
.podium__p--1 .podium__step { min-height: 120px; border-color: rgba(255, 199, 1, 0.45); animation-delay: 0.15s; }
.podium__p--1 .podium__step strong { color: var(--gold); font-size: 36px; }
.podium__p--2 .podium__step { min-height: 96px; }
.podium__p--3 .podium__step { min-height: 80px; animation-delay: 0.08s; }
@keyframes step-up { from { transform: scaleY(0.2); opacity: 0; } }
.lb-table { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 180px 160px; align-items: center; gap: 12px; height: 48px; padding: 0 20px; background: rgba(35, 35, 35, 0.6); border-radius: 2px; animation: panel-in 0.45s var(--ease-out) backwards; animation-delay: var(--d); }
.lb-row--head { height: 32px; background: none; color: var(--muted-2); animation: none; }
.lb-row span:first-child { font: 600 14px var(--f-head); color: var(--muted-2); }
.lb-user { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lb-user img { border-radius: 50%; }
.lb-row:not(.lb-row--head):hover { background: #232323; }

/* ---- empty dark footer band (321 tall in the design) ---- */
.screen > .page-foot { max-width: none; margin: 96px -32px -32px; padding: 24px 48px; background: #0f0f0f; }
.page-foot p { margin: 0; font-size: 12px; line-height: 18px; color: rgba(155, 155, 155, 0.5); }

/* ---- Rewards / Daily cases ---- */
.daily { position: relative; display: flex; align-items: center; min-height: 212px; margin-top: 16px; padding: 24px 32px 24px 86px; background: url("../assets/rewards/banner-bg.jpg") center / 100% 100% no-repeat; }
.daily__text { width: 433px; display: flex; flex-direction: column; gap: 16px; }
.daily h1 { display: flex; align-items: flex-start; gap: 4px; margin: 0; font: 700 32px/48px var(--f-head); color: var(--gold); text-transform: uppercase; }
.daily h1 img { margin-top: 22px; cursor: help; }
.daily p { margin: 0; font-size: 18px; line-height: 27px; }
.daily p i b { font-weight: 700; }
.daily__art { position: absolute; left: 520px; top: 50%; width: 433px; height: auto; transform: translateY(-50%); animation: cases-bob 5s ease-in-out infinite; }
@keyframes cases-bob { 50% { transform: translateY(calc(-50% - 6px)) rotate(-0.6deg); } }
.screen--rewards .title-rule { margin-top: 40px; }
.cases-meta { display: flex; justify-content: center; gap: 112px; margin-top: 8px; text-align: center; }
.cases-meta > div { display: flex; flex-direction: column; align-items: center; }
.cases-meta small { font-size: 12px; line-height: 21px; color: var(--muted-2); }
.cases-meta > div:last-child small { font-size: 13px; }
.cases-meta b { font: 700 16px/24px var(--f-head); color: var(--muted-2); font-variant-numeric: tabular-nums; }
.cases { display: grid; grid-template-columns: repeat(5, 186.69px); justify-content: center; gap: 12px; margin-top: 28px; }
.case {
  position: relative; height: 256px; padding-top: 20px;
  display: flex; flex-direction: column; align-items: center;
  background: center / 100% 100% no-repeat; border-radius: 4px;
  transition: transform 0.3s var(--ease-out), filter 0.3s;
}
.case b { font-weight: 700; line-height: 24px; white-space: nowrap; }
.case__art { position: absolute; top: 72px; height: 96px; width: auto; transition: transform 0.4s var(--ease-back); }
.case__foot { position: absolute; top: 196px; height: 40px; display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 21px; color: #5e5e5e; white-space: nowrap; }
.case__foot > span { display: inline-flex; align-items: center; gap: 8px; }
.case__foot .amt { font: 400 14px/21px var(--f-head); }
.case--locked .case__foot img[src*="coin"] { opacity: 0.45; }
.case:hover { transform: translateY(-6px); filter: brightness(1.1); }
.case:hover .case__art { transform: rotate(-5deg) scale(1.08); }
.case--ready { box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(255, 199, 1, 0.35); animation: ready 1.8s ease-in-out infinite; }
.case--ready .case__foot { color: var(--gold); font: 600 14px var(--f-head); text-transform: uppercase; }
.case--ready .case__art { animation: case-shake 2.4s ease-in-out infinite; }
@keyframes ready { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 40px rgba(255, 199, 1, 0.5); } }
@keyframes case-shake { 0%, 80%, 100% { transform: none; } 84% { transform: rotate(-6deg); } 88% { transform: rotate(6deg); } 92% { transform: rotate(-3deg); } }
.case--opened { filter: grayscale(0.6) brightness(0.75); }
.case--opened .case__foot { color: var(--muted-2); }
.link-discord { position: relative; min-height: 230px; margin-top: 60px; padding: 20px 432px 60px 160px; background: url("../assets/rewards/discord-banner-bg.jpg") center / 100% 100% no-repeat; }
.link-discord h2 { margin: 0 0 16px; font: 400 40px/60px var(--f-head); color: var(--gold); text-transform: uppercase; }
.link-discord p { margin: 0; font-size: 18px; line-height: 27px; }
.link-discord p button { color: var(--gold); text-decoration: underline; font-size: inherit; line-height: inherit; transition: text-shadow 0.2s; }
.link-discord p button:hover { text-shadow: 0 0 12px rgba(255, 199, 1, 0.8); }
.link-discord__steps { display: flex; gap: 20px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted-2); }
.link-discord__steps li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid var(--muted-2); border-radius: 50%; vertical-align: -1px; transition: background 0.3s, border-color 0.3s; }
.link-discord__steps li.is-done { color: var(--green); }
.link-discord__steps li.is-done::before { background: var(--green); border-color: var(--green); }

/* case-opening reel */
.reel { position: relative; height: 140px; overflow: hidden; background: rgba(0, 0, 0, 0.25); border-radius: 4px; mask-image: linear-gradient(90deg, transparent, #000000 15%, #000000 85%, transparent); }
.reel__pointer { position: absolute; z-index: 2; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.reel__pointer::before, .reel__pointer::after { content: ""; position: absolute; left: -7px; border: 8px solid transparent; }
.reel__pointer::before { top: 0; border-top-color: var(--gold); }
.reel__pointer::after { bottom: 0; border-bottom-color: var(--gold); }
.reel__strip { display: flex; gap: 8px; height: 100%; padding: 12px 0; will-change: transform; }
.reel__item { flex: none; width: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(to top, color-mix(in srgb, var(--c) 35%, transparent), #232323 70%); border-bottom: 3px solid var(--c); border-radius: 2px; font: 600 14px var(--f-head); }
.reel__item.is-win { animation: win-pop 0.6s var(--ease-back); box-shadow: 0 0 24px var(--c); }
@keyframes win-pop { 50% { transform: scale(1.12); } }
.reel__result { display: flex; flex-direction: column; align-items: center; margin-top: 20px; animation: panel-in 0.4s var(--ease-out); }
.reel__result small { color: var(--muted-2); }
.reel__result b { font: 700 32px/1.2 var(--f-head); color: var(--gold); }
.reel__actions { display: flex; justify-content: center; margin-top: 20px; }
.reel__actions .btn-gold { width: 208px; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .daily { padding-left: 40px; }
  .daily__art { left: auto; right: 24px; width: 38%; }
  .cases { grid-template-columns: repeat(auto-fit, minmax(170px, 186.69px)); }
  .link-discord { padding: 24px 40% 48px 48px; }
}
@media (max-width: 799.98px) {
  .tiles__row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles__row--3 { grid-template-columns: minmax(0, 1fr); }
  .lb__bar { flex-direction: column; align-items: center; gap: 16px; }
  .lb__timer { position: static; align-items: center; }
  .lb-row { grid-template-columns: 48px minmax(0, 1fr) 110px; padding: 0 12px; }
  .lb-row > :last-child { display: none; }
  .title-rule { gap: 16px; }
  .title-rule h2 { font-size: 30px; }
  .daily { flex-direction: column; align-items: flex-start; padding: 24px; }
  .daily__text { width: 100%; }
  .daily__art { position: static; width: 80%; margin: 16px auto 0; transform: none; animation: none; }
  .cases-meta { gap: 32px; }
  .link-discord { padding: 24px 24px 40px; }
  .link-discord h2 { font-size: 32px; }
  .carousel__arrow--prev { left: -8px; }
  .carousel__arrow--next { right: -8px; }
  .screen > .page-foot { margin: 64px -16px -16px; padding: 24px; }
}
.screen--rewards { padding-top: 0; }
