/* Home page — the hub that links out to every game. */

.hero {
  position: relative;
  padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3rem);
  text-align: center;
  /* The pookalam behind the title turns, and a rotating square sweeps a box up
     to 41% wider than itself — enough to drag a horizontal scrollbar onto the
     page for part of every revolution. Clip sideways only: `clip` leaves the
     vertical axis visible, so the decoration still bleeds above the hero the
     way it is meant to. */
  overflow-x: clip;
}

.hero h1 {
  font-size: clamp(2.4rem, 10vw, 4.4rem);
  margin: .35rem 0 .1rem;
}

.hero .mal {
  display: block;
  font-size: clamp(1.3rem, 5vw, 2rem);
  color: var(--green);
  margin-bottom: .9rem;
}

.hero p {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(.98rem, 2.6vw, 1.1rem);
}

/* Slowly turning pookalam behind the title. Decorative only. */
.hero__deco {
  position: absolute;
  top: -16%;
  left: 50%;
  width: min(420px, 92vw);
  translate: -50% 0;
  opacity: .34;
  z-index: -1;
  animation: slow-spin 120s linear infinite;
  /* Fades out behind the title so the words stay easy to read. */
  -webkit-mask-image: radial-gradient(circle, transparent 26%, #000 62%);
  mask-image: radial-gradient(circle, transparent 26%, #000 62%);
}
.hero__deco svg { display: block; width: 100%; height: auto; }
@keyframes slow-spin { to { rotate: 360deg; } }

.section-head {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin: 0 0 1rem;
}
.section-head h2 { font-size: 1.35rem; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 1rem;
  padding-bottom: 3rem;
  list-style: none;
  margin: 0;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  height: 100%;
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid rgba(192, 138, 30, .22);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
  outline: none;
}

.game-card__icon {
  width: 62px;
  height: 62px;
  margin-bottom: .55rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream-deep);
  box-shadow: inset 0 0 0 2px rgba(192, 138, 30, .35);
}
.game-card__icon svg { width: 40px; height: 40px; }

.game-card h3 { font-size: 1.16rem; }
.game-card .mal { font-size: .92rem; color: var(--green); }
.game-card p {
  margin: .45rem 0 .9rem;
  font-size: .9rem;
  color: var(--muted);
  flex: 1;
}

.game-card__meta {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold);
}
.game-card__meta span:not(:last-child)::after {
  content: " ·";
  color: var(--line);
}

.site-foot {
  padding: 2rem 0 3rem;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  border-top: 1px solid var(--line);
}
.site-foot .mal { display: block; font-size: 1.15rem; color: var(--green); margin-bottom: .3rem; }

/* --- countdown (target date is set in the admin panel) -------------------- */

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  margin: 1.6rem auto 0;
}
.countdown[hidden] { display: none; }

.countdown__label {
  margin: 0;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.countdown__units {
  display: flex;
  gap: .45rem;
}

.countdown__unit {
  min-width: 66px;
  padding: .5rem .4rem .45rem;
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(192, 138, 30, .3);
}
.countdown__unit b {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.countdown__unit span {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown__done {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  color: var(--green);
}

@media (max-width: 400px) {
  .countdown__unit { min-width: 0; flex: 1; }
  .countdown__unit b { font-size: 1.4rem; }
}

/* --- call to action under the hero ---------------------------------------- */

.hero__actions {
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Winners — shown on the homepage once play has closed
   ========================================================================== */

.winners {
  margin: 1.5rem 0 2.25rem;
  padding: 1.5rem 1.35rem 1.75rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #FFFBF0, var(--paper));
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-md);
}

.winners__crown {
  text-align: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed rgba(192, 138, 30, .45);
}
.winners__crown[hidden] { display: none; }

.winners__name {
  margin: .3rem 0 .35rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 8vw, 3.2rem);
  line-height: 1.08;
  color: var(--green);
  overflow-wrap: break-word;
}
.winners__points {
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
}

.winners__heading {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  flex-wrap: wrap;
  margin: 1.4rem 0 .85rem;
  font-family: var(--font-mal);
  font-size: 1.05rem;
  font-weight: 700;
}
.winners__heading span {
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}

.winners__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.winner-card {
  padding: .85rem .95rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid rgba(192, 138, 30, .25);
}
.winner-card__game {
  margin: 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}
.winner-card__mal { font-size: .82rem; color: var(--green); }
.winner-card__who {
  margin: .35rem 0 .1rem;
  font-weight: 800;
  font-size: 1.05rem;
  overflow-wrap: break-word;
}
.winner-card__score {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.winner-card__score small {
  display: block;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.winners__pookalams {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.winners__pick { margin: 0; width: min(230px, 60vw); }
.winners__pickArt svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
}
.winners__pickWho {
  margin-top: .55rem;
  text-align: center;
  font-weight: 700;
}
.winners__pickVotes {
  display: block;
  font-weight: 600;
  font-size: .82rem;
  color: var(--muted);
}

/* The line above the games while a deadline is set but has not yet passed. */
.closing-note {
  margin: 0 0 1.25rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--cream-deep);
  border: 1px dashed var(--gold);
  font-family: var(--font-mal);
  font-size: .92rem;
  text-align: center;
}
.closing-note[hidden] { display: none; }

/* The standings inside the winners panel, and on the results page.
   The homepage does not load board.css, so this cannot lean on .board-wrap for
   its scrolling — without an overflow of its own the table pushes the whole
   page sideways on a narrow screen. */
.winners__standings {
  margin-bottom: .6rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.winners__rule,
.results__rule {
  margin: .6rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}
.winners__rule a,
.results__rule a { font-weight: 700; white-space: nowrap; }

/* On the results page the champion block stands alone rather than sitting at
   the top of a panel, so it needs its own frame. */
.results__crown {
  margin: .5rem 0 0;
  padding: 1.35rem 1.2rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #FFFBF0, var(--paper));
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid var(--gold);
}
