body {
  font-family: 'Segoe UI', sans-serif;
  text-align: center;
  background: #1a1a1a;
  color: #fff;
  margin: 0;
  padding: 20px;
  overscroll-behavior: contain;
}

h1 {
  margin-bottom: 10px;
}

#message {
  margin: 10px 0;
  font-size: 1.1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  max-width: 90vmin;
  margin: 0 auto;
  user-select: none;
  position: relative;
  background: url("images/map-underlay.png");
  background-size: cover;
  background-position: center;
  border: 2px solid #5c4326;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

/* Parchment overlay */
.grid::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url("images/texture.png");
  background-size: cover;
  opacity: 0.2;
  pointer-events: none;
  z-index: 1;
}

.cell {
  position: relative;
  z-index: 2;
  border: 1px solid #555;
  padding-top: 100%;
  cursor: pointer;
  background: rgba(51, 51, 51, 0.75); /* Darken over map */
  transition: background 0.3s;
}

.cell.clicked,
.cell.revealed {
  background: transparent;
  outline: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
}

.cell.clicked {
  border: 2px solid purple;
  box-shadow: 0 0 6px purple;
}

.revealed.cell.clicked {
  border: 2px solid purple !important;
  box-shadow: 0 0 6px purple !important;
}


.cell img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 4px black);
}

button {
  margin-top: 20px;
  padding: 10px 20px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #666;
}

#instructions {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ccc;
  margin: 5px 0 15px;
}

.tap-zone {
  position: fixed;
  width: 50px;
  height: 50px;
  z-index: 1000;
  background: transparent;
}

#messageLog {
  margin-bottom: 16px;
  text-align: center;
}

.message {
  margin: 4px 0;
  font-family: 'Georgia', serif;
  color: #f5f5f5;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}
