/* =========================================================
   muzammilimtiaz.com — playground.css
   "Have Fun" tab: a tech-stack memory match, framed inside a
   decorative iPhone-style case so it reads as "works in your pocket"
   ========================================================= */

.playground-intro {
  color: var(--ink-soft);
  line-height: 1.6;
  font-size: 14px;
  max-width: 640px;
  margin-bottom: 18px;
}

.playground-games {
  display: flex;
  justify-content: center;
}

.playground-games,
.playground-games * {
  /* kill the mobile double-tap-to-zoom delay so taps register instantly */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- decorative phone case ---------- */
.phone-frame {
  position: relative;
  width: min(300px, 82vw);
  padding: 30px 12px 22px;
  background: linear-gradient(155deg, #2a2a2c, #101012);
  border-radius: 34px;
  box-shadow:
    0 22px 44px rgba(0,0,0,0.35),
    inset 0 0 0 2px rgba(255,255,255,0.06),
    inset 0 0 0 6px #050506;
}
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 16px;
  background: #050506;
  border-radius: 10px;
}
.phone-home-bar {
  width: 84px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 3px;
  background: rgba(255,255,255,0.28);
}
.phone-screen {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.playground-window {
  margin: 0;
  border-radius: 0;
}

.playground-body {
  padding: 12px 14px 14px;
  font-family: var(--font-sans);
}

.playground-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.playground-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #b7b2a6;
}
.playground-stat b { color: #f1e6d2; }
.playground-reset {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-soft);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.playground-reset:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }

.playground-msg {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #9ad9ac;
  margin-top: 10px;
  min-height: 1.4em;
}

/* ---------- tech stack memory match ---------- */
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.match-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  /* keep tap targets comfortable on touch screens */
  min-width: 44px;
  min-height: 44px;
}
/* a simple crossfade + pop reveal instead of a 3D flip — renders reliably
   on every browser/device (no backface-visibility or perspective quirks) */
.match-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}
.match-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  padding: 2px;
  line-height: 1.15;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.match-card-back {
  background: linear-gradient(155deg, #322f28, #1c1a16);
  color: var(--accent-soft);
  font-size: 13px;
  opacity: 1;
  transform: scale(1);
}
.match-card-front {
  background: linear-gradient(155deg, #2f6f4f, #1f4d36);
  color: #eafff2;
  opacity: 0;
  transform: scale(0.85);
}
.match-card.flipped .match-card-back,
.match-card.matched .match-card-back {
  opacity: 0;
  transform: scale(0.85);
}
.match-card.flipped .match-card-front,
.match-card.matched .match-card-front {
  opacity: 1;
  transform: scale(1);
}
.match-card.matched .match-card-front {
  background: linear-gradient(155deg, var(--accent-soft), var(--accent));
  color: #fff8ee;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .phone-frame { width: min(280px, 78vw); }
}

@media (max-width: 420px) {
  .phone-frame { width: min(240px, 84vw); padding: 26px 10px 18px; border-radius: 28px; }
  .phone-notch { width: 68px; height: 14px; }
  .match-card-face { font-size: 8.5px; }
}
