/* Match-3 Game Styling - Matches RiK Theme */
/* ---------- GLOBAL STYLES ---------- */
body {
  background: linear-gradient(135deg, #222, #333, #222);
  font-family: 'Roboto', sans-serif;
  color: white;
  text-align: center;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  margin-top: 70px; /* Add some space at the top */
  min-height: 100vh; /* Ensure body takes full height */
}



/* Breadcrumb styling */
.breadcrumb {
  position: relative;
  z-index: 10; /* Higher than canvas or any overlay */
}

  .breadcrumb {
    font-size: 14px;
    padding: 15px 40px;
    background-color: transparent;
    color: #ffcc00;
    text-align: left;
  }
  
  .breadcrumb a {
    color: #EDEAE1;
    text-decoration: none;
    font-weight: 500;
  }
  
  .breadcrumb a:hover {
    text-decoration: underline;
  }

    /* Optional: Responsive font-size */
@media (max-width: 480px) {
  .breadcrumb {
    font-size: 13px;
    padding: 10px 15px;
  }
}

/* ---------- GAME CONTAINER ---------- */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: auto; /* Give it some breathing room */
  flex: 1;
}

/* Game Title */
h1 {
    font-size: 36px;
    color: #FEC107;
    text-shadow: 2px 2px 8px rgba(255, 204, 0, 0.8);
    margin-top: 20px;
    margin-bottom: 5px;
}

/* Scoreboard */
#scoreboard {
    font-size: 15px;
    font-weight: bold;
    color: #FEC107;
    text-shadow: 1px 1px 6px rgba(255, 204, 0, 0.8);
    margin-top: -15px;
    margin-bottom: -15px;
}

/* Game Board */
#gameBoard {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    gap: 5px;
    padding: 15px;
    background-color: #222;
    border-radius: 15px;
    box-shadow: 0px 5px 15px rgba(255, 204, 0, 0.8);
}

/* Individual Cell */
.cell {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: none;
    transition: transform 0.2s ease-in-out;
}

/* Gems */
.gem {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-in-out;
    transform: translateY(calc(var(--row, 0) * 65px)); /* Gravity Effect */
}

/* Hover Effect */
.cell:hover {
    transform: scale(1.1);
}

/* Selected Gem Animation */
.selected {
    transform: scale(1.2);
    transition: transform 0.2s ease-in-out;
}

/* Popping Effect */
@keyframes popOut {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(0); opacity: 0; }
}

.disappear {
    animation: popOut 0.5s ease forwards;
}

/* Smooth Falling Effect */
.falling {
    transition: transform 0.5s ease-in;
}


/* ---------- FOOTER (Unified) ---------- */
footer {
  background: transparent;
  text-align: center;
  font-size: 12px;
  color: #FEC107;
  padding: 10px 0;
  width: 100%;
  margin-top: auto; /* Pushes to bottom when possible */
  position: relative;
}

/* Footer Buttons */
#back-button,
#restart-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  color: black;
  background-color: #FEC107;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
  margin: 3px;
}

.footer-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 0px;
  margin-bottom: 5px;
}


@media screen and (max-width: 520px) {
  /* Game Title */
  h1 {
    font-size: 24px;
    margin-top: 15px;
  }

  /* Scoreboard */
  #scoreboard {
    font-size: 13px;
    margin-top: -10px;
    margin-bottom: -10px;
  }

  /* Game Board - now 45px grid */
  #gameBoard {
    grid-template-columns: repeat(8, 45px);
    grid-template-rows: repeat(8, 45px);
    gap: 5px;
    padding: 10px;
    box-shadow: 0px 4px 12px rgba(255, 204, 0, 0.6);
    border-radius: 12px;
    margin-bottom: 10px; /* reduce space below game board */
  }

  /* Individual Cell */
  .cell {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    overflow: visible;
  }

  /* Gems */
  .gem {
    transform: translateY(calc(var(--row, 0) * 50px)); /* 45px cell + 5px gap */
  }

  /* Selected Gem Animation - more visible */
  .selected {
    transform: scale(1.5);
    z-index: 5;
    box-shadow: 0 0 8px 3px rgba(255, 255, 0, 0.7);
    border: 2px solid #fffacd;
    border-radius: 10px;
  }
}

@media screen and (max-width: 1024px) and (orientation: landscape) {
  header {
    display: none;
  }
}

@media screen and (max-width: 1024px) and (orientation: landscape) {
  main {
    margin-top: 0; /* removes any top space */
    height: 100vh;  /* full height usage */
  }
}

.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;
}
