/* Touch-friendly body */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    -webkit-tap-highlight-color: transparent; /* remove tap highlight */
}

.container {
    text-align: center;
    background: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 95%;
    max-width: 400px;
    min-height: 300px; /* Flexible height */
}


h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 auto;
    touch-action: manipulation;
}

.card {
    width: 100%;
    aspect-ratio: 1/1; /* keep square on all screens */
    background-color: #3498db;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s;
    user-select: none;
}

.card:active {
    transform: scale(0.95); /* press effect */
}

.card.flipped {
    transform: rotateY(180deg);
}

.card .front,
.card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
}

.card .front {
  background-image: url("img/img56.jpeg"); /* ✅ Replace with your image path */
  background-size: cover;   /* Make sure the image covers the card */
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* Prevent tiling */
}


.card .back {
    background-color: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotateY(180deg);
    border: 2px dashed #a25322;
}

.card img {
    width: 70%;
    height: 100%;
    border-radius: 5px;
    pointer-events: none;
}

/* Buttons */
#resetButton {
    margin-top: 20px;
    padding: 15px 25px;
    background-color: #313131;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    width: 100%;
    max-width: 200px;
    transition: background-color 0.3s;
    touch-action: manipulation;
}

#resetButton:active {
    background-color: #444f62;
    transform: scale(0.97);
}

/* Popup modal */
.popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.popup-content h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
}

.popup-content button {
    margin-top: 15px;
    padding: 12px 20px;
    background: #313131;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    max-width: 200px;
    transition: background 0.3s;
    touch-action: manipulation;
}

.popup-content button:active {
    background: #444f62;
    transform: scale(0.97);
}

#termsFooter details {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  background: #f9f9f9;
  cursor: pointer;
  max-width: 800px;
  margin: 20px auto;
}

#termsFooter summary {
  font-size: 20px;
  font-weight: bold;
  color: #000000;
  cursor: pointer;
  list-style: none;
}

#termsFooter summary::-webkit-details-marker {
  display: none; /* hide default arrow */
}

#termsFooter summary::after {
  content: " ▼";
  font-size: 14px;
}

#termsFooter details[open] summary::after {
  content: " ▲";
}

