/* GOOGLE FONT */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans&display=swap');

/* GLOBAL */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans", sans-serif;
  background: #adadad; /* light grey */
    background: #fff; /* white */
  color: #000;
}

/* HAMBURGER MENU */
.hamburger {
  position: fixed;
  top: 14px;
  left: 14px;
  font-size: 30px;
  cursor: pointer;
  z-index: 2000;
  color: #7c7c7c;
}
#side-menu {
  position: fixed;
  top: 0;
  left: -220px;
  width: 200px;
  height: 100%;
  background: #222;
  padding-top: 60px;
  transition: left .28s ease;
  z-index: 1500;
    text-align: left;
}
#side-menu.open { left: 0; }
#side-menu a {
  display: block;
  padding: 14px 18px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
}
#side-menu a:hover { background: #333; }

/* WRAPPER */
.start-wrapper, .container {
  max-width: 980px;
  margin: 0 auto;
  padding-top: 60px; 
  text-align: center;
}

/* TITLE */
.page-title { margin: 8px 0 20px; }

/* THUMBNAILS */
.thumb-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px auto 26px;
}
.thumbnail {
  width: 120px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .14s ease, border-color .14s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #495057;
  flex-direction: column;
  padding: 4px;
}
.thumbnail img {
    width: 100%;
    height: 97px;
    object-fit: cover;
    border-radius: 8px;
    width: 100px;
}
.thumbnail p { margin: 6px 0 0; font-size: 14px; color: #fff; }
.thumbnail:hover { transform: scale(1.04); }


.thumbnail.selected { border-color: #000; background:#faf7f7; color: #000; }
.thumbnail.selected {
    border-color: #000000;
    background: #faf7f7;
    color: #000;
    border: 3px;
    box-shadow: 0 0 10px rgb(0 0 0 / 48%);
    }


.thumbnail.selected p { color: #000; }
#category-grid.thumbnail.selected {color: #000; }



#level-grid.thumbnail{
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background-color: #6c757d; /* grey button */
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* GRID SIZE TILES */
.thumbnail[data-level] {
  width: 110px;
  height: 50px;
  font-weight: 700;
  font-size: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  color: #fff;
  background: #495057;
}


.thumbnail[data-level].selected
 {
    border-color: #fff;
    background-color: #fff;
    color: #000;
}

/* PLAY BUTTONS */
.play-btn, #startBtn, #restartBtn, #saveSettingsBtn {
  background: #147200;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  margin-top: 12px;
}
.play-btn:hover, #startBtn:hover, #restartBtn:hover, #saveSettingsBtn:hover {
  opacity: 0.92;
}

/* HUD */
#hud {
  margin: 14px 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.hud-item { font-size: 18px; color:#888; }

/* MEMORY GRID */
#memory-game {
  margin: 18px auto;
  display: grid;
  gap: 10px;
  justify-content: center;
}

/* CARD FLIP */
.card {
  width: 100px;
  height: 100px;
  perspective: 1000px;
  position: relative;
}
.card .flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}
.card.flipped .flipper {
  transform: rotateY(180deg);
}
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  overflow: hidden;
}
.card-front {
  transform: rotateY(180deg);
  z-index: 2;
}
.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-back {
  background: #d3d3d3;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.card.matched { cursor: default; }

/* MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
}
.modal-content {
  background: #4d4d4d;
  margin: 15% auto;
  padding: 20px;
  width: 280px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
}
.modal-close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

/* LEADERBOARD */
#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  color:#000;
}

#leaderboard-table th, #leaderboard-table td {
  padding: 8px;
  border-bottom: 1px solid #555;
}
#leaderboard-table th { background:#333;   color: #fff;}

/* SMALL SCREENS */
@media (max-width: 560px) {
  .thumbnail { width: 96px; height: 96px; }
  .thumbnail img { height: 72px; }
  .thumbnail[data-level] { width: 96px; height: 96px; font-size: 18px; }
  .card { width: 80px; height: 80px; }
  #memory-game { gap: 8px; }
}
