/* Layout / page */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  padding: 70px;
  position: relative; /* containing block for number overlay */
}

/* Topbar */
.topbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3000;
}
.topbar-icon {
  height: 40px;
  width: 145px;
  cursor: pointer;
}

.gear-container {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 75px 0 0;
}
.gear { cursor: pointer; }
.gear img { width: 20px; height: 20px; }

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: 50px;          /* below the topbar */
  right: 12px;        /* align with topbar edge */
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.05);
  min-width: 130px;
  z-index: 2000;
  overflow: hidden;
}
.dropdown div {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #000;
  transition: background-color 0.15s ease-in-out;
}
.dropdown div:hover { background: rgba(0,0,0,0.05); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 60px);
  grid-template-rows: repeat(6, 60px);
  border: 0;
}

/* Number overlay (sits over grid, but non-interactive) */
#number-overlay {
  pointer-events: none;
}

/* Cells */
.cell {
  width: 60px;
  height: 60px;
  background: white;
  border: none;
  position: relative;
  font-size: 26px;
  font-weight: 500;
  text-align: center;
  line-height: 60px;
  cursor: pointer;
  user-select: none;
}

input.cell {
  text-transform: uppercase;
  font-size: 26px;
  font-weight: 500;
  text-align: center;
  padding: 0;
  margin: 0;
  border: none;
  caret-color: transparent;
  -webkit-appearance: none;
  -webkit-border-radius: 0;
  border-radius: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input.cell:focus {
  outline: none;
  border: 1px solid black;
}

.black {
  background: black;
  cursor: default;
  border: none;
}

/* Small numbers (clue indices) */
.number {
  position: absolute;
  font-size: 10px;
  color: #000000;
  background: transparent;
  padding: 2px 4px;
  border-radius: 2px;
  z-index: 1000;
  font-weight: bold;
  line-height: normal;
}

/* States */
.highlight { background: #add8e6 !important; }
.selected  { background: gold !important; }
.correct   { color: blue !important; }
.error {
  background-image: linear-gradient(135deg, transparent 49%, red 49%, red 51%, transparent 51%) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
}

/* Clue box */
.clue-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 400px;
  margin-top: 20px;
  background: #B0D6FB;
  padding: 12px 20px;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.clue-box button {
  background: none;
  border: none;
  color: black;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  padding: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease-in-out;
}
.clue-box button:hover { background: rgba(0, 0, 0, 0.1); }

#clue {
  font-size: 16px;
  color: black;
  text-align: center;
  flex: 1;
  margin: 0;
}
