.tile-match-challenge-section {
  max-width: 580px;
  margin: 10px auto 0 auto;
  padding: 24px;
  background: #FAE9D5;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.tile-match-challenge-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
  opacity: 0.55;
}

.tile-match-challenge-section .odd-hud {
  margin-bottom: 16px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.tile-match-challenge-section .odd-hud .odd-stat {
  background: rgba(255, 255, 255, 0);
  border: none;
}

.tile-match-challenge-section .odd-hud .odd-stat-label {
  letter-spacing: 0.08em;
}

.time-meter {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.time-meter-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 10px;
  background: #7abf70;
  transition: transform 120ms linear;
}

.time-meter-fill[data-level="ok"] {
  filter: saturate(1.05);
}

.time-meter-fill[data-level="mid"] {
  filter: saturate(1.3);
}

.time-meter-fill[data-level="low"] {
  filter: saturate(1.6);
  animation: qmPulse 420ms ease-in-out infinite;
}

.tile-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 12px;
  padding: 14px;
  /* background: rgba(0, 0, 0, 0.04); */
  border-radius: 16px;
  position: relative;
  z-index: 1;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(.2, .9, .25, 1);
  --match-color: #ffffff;
  --match-text: #000000;
}

.tile.flipped {
  transform: rotateY(180deg);
}

.tile-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.tile-back {
  background:
    /* Curved highlight (top) */
    radial-gradient(140% 120% at 35% 10%, rgba(70, 70, 70, 0.55), rgba(255, 255, 255, 0) 58%),
    /* Curved darken (bottom) */
    radial-gradient(140% 115% at 50% 120%, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 62%),
    #000;
}

.tile-front {
  transform: rotateY(180deg);
  color: var(--match-text, #000);
  background: radial-gradient(140% 115% at 50% 120%, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 62%), var(--match-color);
  font-weight: 800;
  font-size: 5rem;
}

.tile.matched {
  cursor: default;
}

/* Overlay tweaks for rounded breakpoints (1000 / 800) - placed above 600px rules */
@media (max-width: 1000px) {
  .tile-match-challenge-section {
    max-width: 580px;
    margin: 10px auto 0 auto;
  }

  .tile-grid {
    gap: 12px;
    padding: 12px;
  }

  .tile-match-challenge-section .odd-hud {
    margin-bottom: 14px;
  }

  .tile-front {
    font-size: 4.2rem;
  }
}

@media (max-width: 800px) {
  .tile-match-challenge-section {
    max-width: 480px;
    margin: 10px auto 0 auto;
  }

  .tile-grid {
    gap: 11px;
    padding: 10px;
  }

  .tile-match-challenge-section .odd-hud {
    margin-bottom: 10px;
  }

  .tile-front {
    font-size: 3rem;
  }
}

/* Small-screen overlay tweaks */
@media (max-width: 600px) {
  .tile-match-challenge-section {
    max-width: 320px;
    margin: 10px auto 0 auto;
    padding: 12px 14px;
  }

  .tile-grid {
    gap: 5px;
    padding: 5px;
  }

  .tile-match-challenge-section .odd-hud {
    margin-bottom: 2px;
  }

  .tile-front {
    font-size: 2rem;
  }
}