/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background-color: #f7f7f7;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}


.container {
    max-width: 500px;
    max-height: 100vh;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    padding: 24px;
    text-align: center;
    margin: 0 auto;
    overflow: auto;
}


.start-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-65%, -20%) rotate(-10deg);
    display: flex; /* Use flexbox for internal layout (arrow and text) */
    flex-direction: column; /* Stack arrow and text vertically */
    align-items: center; /* Center items horizontally within the hint */
    justify-content: center; /* Center items vertically within the hint */
    padding: 15px;
    
    color: white;
    border-radius: 8px;
    z-index: 1000; /* Make sure it's above other elements */
    text-align: center;
    pointer-events: none; /* Allows clicks to pass through the hint to the cards below */
    opacity: 0; /* Initially hidden */
    transition: opacity 0.3s ease-in-out; /* Smooth fade in/out */
}

.start-hint.show {
    opacity: 1; /* Show the hint */
}

.start-hint .arrow {
    font-size: 3em;
    margin-bottom: 5px;
    animation: bounce 1s infinite; /* Add a little animation */
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0px 0px 8px rgba(0,0,0,0.9);
}

.start-hint .hint-text {
    font-size: 1.3em;
    font-weight: bold;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0px 0px 8px rgba(0,0,0,0.9);
      background-color: rgba(0, 0, 0, 0.1); /* Semi-transparent background for better readability */
      border-radius: 15px;
    }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}



.logo {
    max-width: 250px;
    margin: 0 auto 20px auto;
    display: block;
}

#memoryGameTitle {
    font-size: 24px;
    color: #bfa67a; /* L'Oréal gold tone */
    margin-bottom: 16px;
}

/* Dashboard */
.dashboard {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;
    padding: 8px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.dashboard-element {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #222;
    gap: 6px;
}

.dashboard-icon {
    color: #bfa67a; /* L'Oréal gold tone */
    font-size: 18px;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.dashboard-icon:hover {
    transform: scale(1.2);
    cursor: pointer;
}

/* Stars */
#stars {
    margin: 16px 0;
}

#stars .fas {
    color: #bfa67a;
    font-size: 20px;
    margin: 0 4px;
    opacity: 0.9;
}

/* Hide Utility Class */
.hide {
  display: none !important;
}

/* Form (difficulty selector) */
#form {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    gap: 8px;
}

#form input[type="radio"] {
    display: none;
}

#form label {
    cursor: pointer;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fafafa;
    color: #555;
}

#form label.checked,
#form label.active-difficulty {
    background-color: #bfa67a;
    color: #fff;
    border-color: #bfa67a;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 6px;
    margin-top: 16px;
    position: relative;
}

.card-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
    perspective: 1000px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    transition: transform 0.6s;
    backface-visibility: hidden;
    overflow: hidden;
}

.front {
    background-color: #ffd4d4;
    background-image: url('../herbalia.png'); /* Replace with your logo path */
    background-size: 60%; /* Adjust to your needs */
    background-repeat: no-repeat;
    background-position: center;
    transform: rotateY(0deg);
}

.back {
    transform: rotateY(180deg);
    background-color: #fff;
}

.front-open {
    transform: rotateY(180deg);
}

.back-open {
    transform: rotateY(0deg);
}

.front-correct,
.back-correct {
    border: 2px solid #bfa67a;
    box-shadow: 0 0 10px #bfa67a;
}

/* Card image */
.icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 10px;
    overflow: auto;
}

.modal.hide {
    display: none;
}

.modal-inner {
    background-color: #fff;
    padding: 24px;
    border-radius: 16px;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: fadeIn 0.5s ease;
}

.modal-inner h3 {
    font-size: 22px;
    color: #222;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 1.2rem;
    color: #444;
    margin: 6px 0;
}

/* Container for discount code section */
.discount-code {
    margin-top: 12px;
    padding: 10px 16px;
    background-color: #f5fbe6;
    color: #3e4e2c;
    font-weight: 600;
    font-size: 1.3rem;
    border-radius: 16px;
    border: 2px solid #d5e6b6;
    max-width: 100%;
    user-select: text;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
}

/* Label above the code and button */
.discount-code-label {
    font-weight: 700;
    font-size: 1rem;
    user-select: none; /* so label text is not accidentally selected */
}

/* Row containing code and button */
.discount-code-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Code text styling */
.discount-code #discountCode {
    font-family: 'Courier New', Courier, monospace;
    background-color: #ff0000;
    padding: 4px 8px;
    border-radius: 12px;
    letter-spacing: 0.05em;
    user-select: text;
    flex-grow: 1;
    max-width: 70%;
    overflow-wrap: break-word;
}

.discount-buttons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

#copyCodeBtn {
  flex: 1;
  cursor: pointer;
  background-color: #efff00;
  color: #0011ff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 3px 6px rgba(191,166,122,0.6);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}

#copyCodeBtn:hover {
  background-color: #0011ff;
  color: #efff00;
  box-shadow: 0 5px 12px rgba(160,138,95,0.7);
}

.shop-button {
  flex: 1;
  text-align: center;
  background-color: #1fb758;
  color: #ffffff;
  font-weight: 600;
  border: 4px solid #1fb758;
  border-radius: 20px;
  font-size: 1.1rem;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-shadow: none;
}

.shop-button:hover {
  background-color: #ffffff;
  color: #1fb758;
  
}

.copy-toast {
  position: absolute;
  bottom: 20px; /* adjust depending on modal layout */
  left: 50%;
  transform: translateX(-50%);
  background-color: #bfa67a; /* gold tone */
  color: white;
  padding: 8px 20px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  box-shadow: 0 3px 8px rgba(191,166,122,0.7);
  bottom: 250px; /* moved higher */
}

.copy-toast.show {
  opacity: 1;
  pointer-events: auto;
}


#replay {
    cursor: pointer;
    color: #bfa67a;
    font-weight: bold;
    font-size: 1.3rem;
    margin-top: 16px;
    display: inline-block;
    transition: all 0.3s ease;
}

#replay:hover {
    transform: scale(1.05);
    text-decoration: underline;
}

#copyResultsButton {
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 14px;
    background-color: #bfa67a;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#copyResultsButton:hover {
    background-color: #a08a5f;
}

/* Share Buttons */
.share-buttons {
    margin-top: 12px;
    text-align: center;
}

.share-buttons p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 8px;
}

.share-btn {
    display: inline-block;
    padding: 6px 10px;
    margin: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #fff;
    border-radius: 16px;
    transition: background-color 0.3s ease;
}

.fb { background-color: #3b5998; }
.wa { background-color: #25D366; }
.vb { background-color: #665CAC; }
.tg { background-color: #0088cc; }

.share-btn:hover {
    opacity: 0.85;
}


/* Promo Section */
.promo-section {
    margin: 16px 0;
}

.promo-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promo-image:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
        grid-gap: 6px;
    }

    .dashboard {
        flex-direction: grid;
        gap: 8px;
    }

    .container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
    }

    #form {
        flex-direction: column;
        gap: 6px;
    }
}


/* Overlay covering entire viewport */
.memory-overlay {
  position: fixed;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  z-index: 999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.memory-overlay.open {
  visibility: visible;
  opacity: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  max-height: 100vh;
}

#memoryGamePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  z-index: 1001; /* higher than sticky nav etc */
  padding: 2rem;
  border-radius: 1rem;
  overflow: auto;
}


#memoryGamePanel {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%) translateX(100%);
  transition: transform 0.7s ease-in-out;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  max-height: 100vh;
  background-color: #fce7f3;
  padding: 0.4rem;
  border-radius: 15px;
  
}

#memoryGamePanel.open {
  transform: translateY(-50%) translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
  border-radius: 15px;
}


  

/* Sticky Game Button */
#openGameButton {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: #83b735;
  color: white;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  
  cursor: pointer;
  z-index: 100;
  transition: background-color 0.2s;
}

#openGameButton:hover {
  background-color: #83b735;
}


.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #fff;
  color: #db2777;
  border: 2px solid #db2777;
  border-radius: 9999px;
  width: 30px;
  height: 30px;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1002;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.close-btn:hover {
  background-color: #db2777;
  color: white;
}


@media (min-width: 500px) {
  #memoryGamePanel {
    
    right: 0; /* Sticks to the right side of the screen */
    width: 450px; 
  }
}

@media (min-width: 500px) and (max-height: 699px) {
  #memoryGamePanel {
    width: 350px;
  }
}

@media (orientation: landscape) and (max-height: 599px) {
  .start-hint {
    display: none;
  }

  .discount-code {
    margin-top: 150px;
    
  }
}


