/*
 * TERA OPTIONS — the game look shared by /offers and the homepage's rewards band: colours per rarity, gold buttons,
 * kickers, drifting sparks, the grid floor and the hand of reward cards. Put .gm-scope on a section (the offers page
 * uses body.of) to get the colours. Motion is skipped for people who ask for reduced motion.
 */
.of, .gm-scope {
  --gm-bg: #060d1c;
  --gm-panel: #0c1730;
  --gm-line: rgba(140, 170, 230, 0.16);
  --gm-text: #c3cfe4;
  --gm-dim: #8193b3;
  --r-common: #5fe0cc;
  --r-rare: #5b8fff;
  --r-epic: #b07cff;
  --r-legend: #f6b93b;
  --gm-font: "Chakra Petch", "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
}
html[lang="ar"] :is(.of, .gm-scope) { --gm-font: "IBM Plex Sans Arabic", "Chakra Petch", sans-serif; }

/* buttons */
.gm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--gm-font); font-weight: 700; font-size: 15px; letter-spacing: 0.03em; text-decoration: none !important; white-space: nowrap; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background-color .2s; }
.gm-btn-gold { color: #2a1a00 !important; background: linear-gradient(180deg, #ffd56a, #f0a91c); box-shadow: 0 6px 0 #a96d05, 0 10px 24px -6px rgba(246, 185, 59, 0.6); }
.gm-btn-gold:active { transform: translateY(4px); box-shadow: 0 2px 0 #a96d05; }
.gm-btn-ghost { color: #fff !important; border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.04); }
@media (hover: hover) {
  .gm-btn-gold:hover { box-shadow: 0 6px 0 #a96d05, 0 14px 32px -6px rgba(246, 185, 59, 0.8); }
  .gm-btn-ghost:hover { border-color: #fff; }
}
.gm-kicker { display: inline-flex; margin-bottom: 16px !important; }
.gm-kicker span { padding: 5px 12px; border-radius: 4px; font-family: var(--gm-font); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #2a1a00; background: linear-gradient(90deg, #ffd56a, #f0a91c); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
html[lang="ar"] .gm-kicker span { letter-spacing: 0; }
.gm-kicker-epic span { color: #fff; background: linear-gradient(90deg, #b07cff, #6d3ad6); }

.gm-sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* a perspective grid "floor" under the cards */
.gm-floor { position: absolute; inset-inline: -20%; bottom: -10%; height: 55%; pointer-events: none; transform: perspective(500px) rotateX(62deg); transform-origin: 50% 100%;
  background-image: linear-gradient(rgba(91, 143, 255, 0.22) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 143, 255, 0.22) 1px, transparent 1px); background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%); mask-image: linear-gradient(to top, #000 10%, transparent 85%); }
.gm-hl { background: linear-gradient(90deg, #ffd56a, #f6b93b 40%, #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gm-lead { margin-top: 20px !important; font-size: 17px; color: var(--gm-text); max-width: 32em; }

/* the hand of cards */
.gm-hand { position: relative; height: 400px; display: flex; justify-content: center; align-items: center; perspective: 1200px; }
.gm-card { --c: var(--r-common); --rot: 0deg; --dx: 0px; --dy: 0px; position: absolute; width: 184px; height: 276px;
  transform: translate(calc(var(--dx) + var(--push, 0px)), var(--dy)) rotate(var(--rot));
  /* a card being left keeps its place on top until it has mostly settled, so it never snaps behind its neighbour */
  transition: transform .5s cubic-bezier(.22, .9, .3, 1), filter .3s, z-index 0s linear .22s; }
/* the lifted card's hit area still covers where it sat, so the pointer can't slip off its lower edge and make it bounce */
.gm-card::before { content: ''; position: absolute; inset: 0 -4px -36px; }
.gm-card:nth-child(1) { --rot: -10deg; --dx: -282px; --dy: 26px; z-index: 1; }
.gm-card:nth-child(2) { --rot: -3.5deg; --dx: -94px; --dy: 4px; z-index: 2; }
.gm-card:nth-child(3) { --rot: 3.5deg; --dx: 94px; --dy: 4px; z-index: 3; }
.gm-card:nth-child(4) { --rot: 10deg; --dx: 282px; --dy: 26px; z-index: 4; }
html[dir="rtl"] .gm-card:nth-child(1) { --rot: 10deg; --dx: 282px; }
html[dir="rtl"] .gm-card:nth-child(2) { --rot: 3.5deg; --dx: 94px; }
html[dir="rtl"] .gm-card:nth-child(3) { --rot: -3.5deg; --dx: -94px; }
html[dir="rtl"] .gm-card:nth-child(4) { --rot: -10deg; --dx: -282px; }
.r-rare { --c: var(--r-rare); }
.r-epic { --c: var(--r-epic); }
.r-legend { --c: var(--r-legend); }
@media (hover: hover) {
  .gm-card:hover { z-index: 9; transform: translate(var(--dx), calc(var(--dy) - 26px)) rotate(0deg) scale(1.06); transition-delay: 0s; }
}
/* the other cards ease aside to make room for the one under the pointer */
@media (hover: hover) and (min-width: 641px) {
  .gm-card:has(~ .gm-card:hover) { --push: -18px; }
  .gm-card:hover ~ .gm-card { --push: 18px; }
  html[dir="rtl"] .gm-card:has(~ .gm-card:hover) { --push: 18px; }
  html[dir="rtl"] .gm-card:hover ~ .gm-card { --push: -18px; }
}
.gm-card-in { position: relative; height: 100%; padding: 14px; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, #0c1730), #0a1428 55%); border: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 22px 40px -14px rgba(0, 0, 0, 0.8), 0 0 28px -6px color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 30px -10px color-mix(in srgb, var(--c) 55%, transparent);
  transform: rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); transform-style: preserve-3d; transition: transform .35s cubic-bezier(.22, .9, .3, 1); }
/* holographic sweep that follows the pointer */
.gm-card-in::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 45%, color-mix(in srgb, var(--c) 45%, transparent) 52%, transparent 65%);
  background-size: 250% 250%; background-position: var(--mx, 100%) var(--my, 0%); transition: background-position .35s ease-out; }
.r-legend .gm-card-in::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, rgba(255, 225, 140, 0.9) 80%, transparent 90%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; animation: gmSpin 4s linear infinite; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes gmSpin { to { --a: 360deg; } }
.gm-card header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gm-rarity { font-family: var(--gm-font); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c); }
html[lang="ar"] .gm-rarity { letter-spacing: 0; font-size: 13px; }
.gm-state { white-space: nowrap; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.gm-state.ok { color: #04291f; background: var(--r-common); }
.gm-state.soon { color: #2a1a00; background: var(--r-legend); }
.gm-art { position: relative; flex: 1; display: grid; place-items: center; margin: 10px 0; border-radius: 10px;
  background: radial-gradient(60% 60% at 50% 45%, color-mix(in srgb, var(--c) 35%, transparent), transparent 75%), rgba(0, 0, 0, 0.25); }
.gm-art svg { direction: ltr; width: 82%; height: auto; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.gm-lock { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 13, 28, 0.55); border-radius: inherit; }
.gm-lock svg { width: 46px; height: 46px; fill: none; stroke: #ffe39a; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 10px rgba(246, 185, 59, 0.7)); }
.gm-card h3 { font-family: var(--gm-font); font-size: 16px; font-weight: 700; line-height: 1.2; }
.gm-val { margin-top: 4px !important; font-family: var(--gm-font); font-weight: 700; font-size: 20px; color: var(--c); line-height: 1.25; }
.gm-val small { font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif; font-weight: 500; font-size: 12px; color: var(--gm-text); }
/* dealt in when the page opens */
.gm-hand.deal .gm-card { animation: gmDeal .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.gm-hand.deal .gm-card:nth-child(2) { animation-delay: .1s; }
.gm-hand.deal .gm-card:nth-child(3) { animation-delay: .2s; }
.gm-hand.deal .gm-card:nth-child(4) { animation-delay: .3s; }
@keyframes gmDeal { from { opacity: 0; transform: translate(0, 220px) rotate(0deg) scale(.7); } }

@media (max-width: 1180px) {
  .gm-card { width: 168px; height: 260px; }
  .gm-card:nth-child(1), html[dir="rtl"] .gm-card:nth-child(4) { --dx: -246px; }
  .gm-card:nth-child(4), html[dir="rtl"] .gm-card:nth-child(1) { --dx: 246px; }
  .gm-card:nth-child(2), html[dir="rtl"] .gm-card:nth-child(3) { --dx: -82px; }
  .gm-card:nth-child(3), html[dir="rtl"] .gm-card:nth-child(2) { --dx: 82px; }
}
@media (max-width: 1023px) {
  .gm-hand { height: 340px; }
}
@media (max-width: 640px) {
  /* the hand becomes a swipeable row of cards */
  .gm-hand { height: auto; display: flex; justify-content: flex-start; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 18px 16px 26px; scrollbar-width: none; perspective: none; }
  .gm-hand::-webkit-scrollbar { display: none; }
  .gm-card, .gm-card:nth-child(n), html[dir="rtl"] .gm-card:nth-child(n) { position: relative; flex: none; width: 200px; height: 284px; --rot: 0deg; --dx: 0px; --dy: 0px; scroll-snap-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .gm-hand.deal .gm-card, .r-legend .gm-card-in::before { animation: none !important; }
}
.gm-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }
.gm-hand.wait .gm-card { opacity: 0; }
