/* The club page (yalda.taminfalat.com/club): the competition, the leaderboard and the rules. The
   game, «شکارچی طلا», opens in its own window over it (arcade.css). */
@font-face {
  font-family: "Kalameh";
  src: url("fonts/Kalameh-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Kalameh";
  src: url("fonts/Kalameh-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Kalameh";
  src: url("fonts/Kalameh-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Kalameh";
  src: url("fonts/Kalameh-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Kalameh";
  src: url("fonts/Kalameh-Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

/* an element marked hidden stays hidden, whatever display its class gives it */
[hidden] {
  display: none !important;
}

/* The club page in Yalda's design system (/ui/yalda.css): white cards on the cream page. */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body.club {
  --page-max: 1288px; /* the same width as the shop page (/) */
  margin: 0;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
}

/* the same width as the shop page's sections: 16px in from each side, at most 1288px */
.c-main {
  width: min(100% - 32px, 1288px);
  margin: 0 auto;
  padding-top: 16px;
}
@media (min-width: 768px) {
  .c-main {
    padding-top: 24px;
  }
}

/* ---------- the competition ---------- */
.c-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px 24px;
  text-align: center;
}
.c-hero__deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.9;
}
.c-hero__deco--1 {
  top: -10px;
  inset-inline-start: -10px;
  width: clamp(56px, 8vw, 84px);
  transform: rotate(-14deg);
}
.c-hero__deco--2 {
  top: 14px;
  inset-inline-end: 14px;
  width: clamp(40px, 5vw, 60px);
  transform: rotate(12deg);
}
/* the game's logo (its picture holds the name and its line, cut to the drawing);
   on a phone narrow enough to stay clear of the watermelon in the corner */
.c-logo {
  width: min(100%, 260px);
  margin: 18px 0 6px;
  line-height: 0;
}
.c-logo img {
  display: block;
  width: 100%;
  height: auto;
}
.c-lead {
  margin: 0;
  max-width: 480px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.9;
}
.c-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-top: 12px;
}
@media (min-width: 576px) {
  .c-actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
  .c-play {
    min-width: 200px;
  }
  .c-logo {
    width: 360px;
    margin-top: 0;
  }
}
@media (min-width: 992px) {
  .c-hero {
    padding: 40px 32px 32px;
  }
  .c-logo {
    width: 460px;
  }
  .c-lead {
    max-width: 640px;
    font-size: 16px;
  }
}

/* ---------- KPI tiles: prize, time, your best, your rank ---------- */
.c-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 768px) {
  .c-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.c-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px;
}
.c-kpi__label {
  color: var(--muted-foreground);
  font-size: 12px;
}
.c-kpi__value {
  color: var(--foreground);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}
.c-kpi--prize .c-kpi__value {
  color: var(--primary);
}
@media (min-width: 768px) {
  .c-kpi__value {
    font-size: 18px;
  }
}
@media (min-width: 992px) {
  .c-kpi__value {
    font-size: 20px;
  }
}

/* ---------- the leaderboard and the four numbers: side by side from 860px up, the table on the
   right half, the numbers two by two on the left, as tall as the table ---------- */
.c-split {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.c-split > .c-kpis,
.c-split > .c-board {
  margin-top: 0;
}
@media (min-width: 860px) {
  .c-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .c-split > .c-board {
    grid-column: 1;
    grid-row: 1;
  }
  .c-split > .c-kpis {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 16px;
  }
  .c-split .c-kpi {
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
  .c-split .c-kpi__label {
    font-size: 13px;
  }
  .c-split .c-kpi__value {
    font-size: 22px;
  }
}

/* ---------- the leaderboard ---------- */
.c-card {
  padding: 20px;
}
/* the shop's «جدول کامل» opens /club#board: the table stops a little below the screen's top on
   a phone, and below the top bar (sticky from 768px up, 68px) on a wider screen, not under it */
.c-board {
  margin-top: 12px;
  scroll-margin-top: 16px;
}
@media (min-width: 768px) {
  .c-board {
    scroll-margin-top: 88px;
  }
}
.c-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.c-card__head .ui-card__desc {
  font-size: 12px;
}
.c-card__head .ui-card__desc:empty {
  display: none;
}

.c-ranks > li {
  min-height: 60px;
}
/* the medal of the first three: .ui-rank in /ui/yalda.css */
.c-ranks__n {
  width: 34px;
  height: 34px;
  font-size: 14px;
}
.c-ranks__name {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}
.c-ranks__name b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-ranks__name bdi {
  color: var(--muted-foreground);
  font-size: 12px;
  text-align: right;
}
.c-ranks__score {
  color: var(--foreground);
  font-size: 16px;
  font-weight: 800;
}

/* ---------- the shop, a word at the top ----------
   On a phone at the top in the middle, down from above; on a wide screen top left, under the top
   bar, in from the side. A card with the pomegranate's edge on its right, a line and the way to
   the shop. */
.c-toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 0;
  left: 0;
  z-index: 40;
  margin-inline: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 16px 14px 12px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, var(--primary-soft) 0, rgb(255 255 255 / 0) 90px),
    var(--card);
  box-shadow:
    0 18px 40px -18px rgb(74 14 28 / 0.45),
    0 2px 8px -2px rgb(43 26 29 / 0.12);
  animation: c-toast-down 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.c-toast.is-leaving {
  animation: c-toast-up 0.22s ease-in both;
}
@media (min-width: 768px) {
  .c-toast {
    top: 88px;
    right: auto;
    left: 20px;
    margin-inline: 0;
    animation-name: c-toast-in;
  }
  .c-toast.is-leaving {
    animation-name: c-toast-out;
  }
}
.c-toast__body {
  flex: 1;
  min-width: 0;
}
.c-toast__title {
  display: block;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}
.c-toast__text {
  margin: 2px 0 10px;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.8;
}
.c-toast__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.c-toast__tel {
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.c-toast__close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted-foreground);
  cursor: pointer;
}
.c-toast__close:hover {
  background: var(--muted);
  color: var(--foreground);
}
.c-toast__close:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.c-toast__close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
@keyframes c-toast-in {
  from {
    opacity: 0;
    transform: translateX(-24px) scale(0.98);
  }
}
@keyframes c-toast-out {
  to {
    opacity: 0;
    transform: translateX(-16px);
  }
}
@keyframes c-toast-down {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
}
@keyframes c-toast-up {
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .c-toast,
  .c-toast.is-leaving {
    animation-duration: 0.01s;
  }
}
