/* Ensure the entire page takes full height */
html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle, #3D8E41 20%, #1B5E20 60%, #0A3C10 100%);
  font-family: Arial, sans-serif;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Breadcrumb Styling */
.breadcrumb {
  font-size: 14px;
  padding: 12px 12px;
  background-color: transparent;
  color: #ffcc00;
  text-align: left;
  margin-top: 60px; 
  margin-bottom: -20px; 
}

.breadcrumb a {
  color: #EDEAE1;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}


@media screen and (max-width: 812px) and (orientation: landscape) {
  header,
  .breadcrumb {
    display: none !important;
  }
}

/* Center the main content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

/* Title Styling */
h1 {
  color: #FFD700;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
  font-family: 'Roboto', sans-serif;
  text-align: center;
  width: 100%;
  margin-top: 20px;
  margin-bottom: -50px;
}

/* Game Area Layout */
#game-area,
#card-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Deck Styling */
#deck {
  width: 100px;
  height: 130px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('deck-back.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* Discard Pile Styling */
#discard-pile {
  width: 80px;
  height: 120px;
  border: 2px solid black;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
}

#discard-pile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#discard-pile:has(img) {
  color: transparent;
}

@media screen and (max-width: 600px) {
  h1 {
    font-size: 28px;
    margin-top: 20px;
    margin-bottom: -20px;
  }

  #deck {
    width: 70px;
    height: 100px;
  }

  #discard-pile {
    width: 60px;
    height: 90px;
  }

  #game-area,
  #card-area {
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
  }
}

/* 📱 Portrait: Adjust sizes for smaller screens */
@media screen and (max-width: 812px) and (orientation: landscape) {
  h1 {
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: -15px;
  }

  #deck {
    width: 60px;
    height: 85px;
  }

  #discard-pile {
    width: 55px;
    height: 80px;
  }

  #game-area,
  #card-area {
    gap: 8px;
    margin-top: 10px;
  }
}


/* 🎴 Player Hand Layout */
#player-hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px;
  max-width: 100%;
}

/* 🃏 Card Appearance */
.card {
  width: 80px;
  height: auto;
  border-radius: 5px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

/* ⭐ Selected Card Style */
.selected {
  border: 3px solid #FFD700;
  transform: scale(1.1);
}

/* 🎮 Game Controls */
#controls {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px;
}

/* 🔘 Button Styling */
button {
  background-color: #FFD700;
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #ffcc00;
}

/* 📱 Mobile Portrait: Fit 5 cards in a row */
@media screen and (max-width: 600px) {
  #player-hand {
    gap: 6px;
    padding: 15px 5px;
  }

  .card {
    width: 60px;
  }

  button {
    font-size: 14px;
    padding: 8px 12px;
  }

  #controls {
  margin-top: 5px !important; /* Less space above on mobile */
}

}

/* 🧭 Landscape Mode Handling */
@media screen and (max-width: 812px) and (orientation: landscape) {
  #player-hand {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 10px;
    gap: 6px;
    max-width: 100vw;
  }

  #player-hand .card {
    width: 50px;
    height: 65px;
    font-size: 10px;
  }

  /* Optional: shrink buttons too */
  #controls {
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px;
    justify-content: center;
  }

  #controls button {
    font-size: 12px;
    padding: 6px 8px;
  }
}

/* 🪟 Modal Background Overlay */
/* Modal base styling */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5); /* Dim background */
}

/* Modal content box */
.modal-content {
  background-color: #fefefe;  /* Light background */
  color: #000;                /* Dark text */
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Close button */
.modal-content .close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal-content .close:hover,
.modal-content .close:focus {
  color: #000;
  text-decoration: none;
}


/* ❌ Close Button */
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 22px;
  color: #333;
}

/* 📱 Mobile Portrait */
@media screen and (max-width: 600px) {
  .modal-content {
    width: 90%;
    margin: 20% auto;
    padding: 15px 20px;
    font-size: 14px;
  }

  .close {
    font-size: 20px;
  }
}

/* 🧭 Landscape Mobile */
@media screen and (orientation: landscape) and (max-height: 480px) {
  .modal-content {
    width: 80%;
    margin: 10% auto;
    padding: 15px;
    font-size: 13px;
  }
}

/* 📍 Footer Styling */
footer {
  text-align: center;
  color: white;
  background-color: transparent;
  margin-top: 30px;
  padding: 10px;
  width: 100%;
  font-size: 16px;
  font-weight: 500;
}

/* Mobile Responsive Footer */
@media screen and (max-width: 600px),
       screen and (orientation: landscape) and (max-height: 480px) {
  footer {
    font-size: 14px;
    padding: 8px;
  }
}


.fixed-footer-menu-games {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #222;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 2px solid #FEC107;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Menu Item */
.fixed-footer-menu-games .menu-item {
  flex: 1;
  text-align: center;
  color: #FEC107;
  text-decoration: none;
  font-size: 11px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  height: 100%;
}

/* Icon inside Menu */
.fixed-footer-menu-games .icon {
  font-size: 20px;
  margin-bottom: 2px;
}

/* Hide fixed footer on desktop */
@media screen and (min-width: 768px) {
  .fixed-footer-menu-games {
    display: none;
  }
}

/* Make sure body has bottom padding so content doesn't hide under footer */
body {
  padding-bottom: 80px;
}

.more-games-drawer {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  max-height: 60vh;
  background: #111;
  border-top: 2px solid #FEC107;
  z-index: 999;
  padding: 10px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.more-games-drawer .drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 14px;
  color: #FEC107;
}

.more-games-drawer .games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.more-games-drawer .games-grid a {
  background-color: #222;
  color: #FEC107;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  text-align: center;
}

