* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #111;
  color: #e6e6e6;
}

.topbar {
  text-align: center;
  padding: 15px;
  background: #1c1c1c;
  border-bottom: 2px solid #506c84;
}

.topbar h1 {
  color: #506c84;
}

.layout {
  display: flex;
  max-width: 1200px;
  margin: auto;
  padding: 15px;
  row-gap: 30px;
  column-gap: 20px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #1b1b1b;
  border: 1px solid #333;
  padding: 15px;
  border-radius: 8px;
  position: sticky;
  top: 10px;
  height: fit-content;
}

#me img {
  width: 100%;
  border-radius: 6px;
  border: 3px solid #506c84;
}

#name {
  text-align: center;
  margin-top: 10px;
  color: #506c84;
}

.tracker {
  text-align: center;
  margin-top: 20px;
}

.tracker p {
    margin-bottom: 15px;
}

#score {
  font-size: 26px;
  margin-bottom: 10px;
}

button {
  background: #506c84;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background: #6d8aa3;
}

.room {
  display: grid;
  gap: 15px;
  margin-top: 20px;
  text-align: center;
}

.room input {
  width: 100%;
  margin-top: 5px;
  padding: 6px;
  border-radius: 4px;
  border: none;
}

#roomCodeForm {
  display: grid;
  gap: 20px;
}

#roomCodeInput {
  text-align: center;
}

/* Gameboard */
#gameboard {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
}

/* Card */
.card-container {
  text-align: center;
}

.card {
  display: grid;
  background: #222;
  border: 1px solid #506c84;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: 0.3s;
  object-position: top;
}

/* Flipped = greyed out + smaller image */
.card.flipped img {
  filter: grayscale(100%) brightness(40%);
  transform: scale(0.6);
}

.card-name {
  margin-top: 4px;
  font-size: 13px;
  color: #aaa;
}

/* Popup */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: #1c1c1c;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Footer */
footer {
  text-align: center;
  padding: 15px;
  font-size: 13px;
  color: #666;
}

/* Responsive */
@media (max-width: 800px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
  }
}


.popup-content button {
  margin: 5px;
  padding: 10px 20px;
}
