/* global page styling */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f4f4;
  color: #333;
  margin: 0;
  padding: 0;
}

/* grid container: 4 columns x 4 rows */
.grid-container {
  display: grid;
  grid-template-columns: 120px repeat(3, 1fr);
  grid-template-rows: 60px repeat(3, 1fr);
  gap: 5px;
  margin: 20px auto;
  width: 600px;
  max-width: 95vw;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  padding: 10px;
}

/* header/label cells */
.label-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #eef2f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow-wrap: break-word;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  min-height: 50px;
  max-width: 120px;
}

.label-cell.shrink {
  font-size: 0.65rem;
}

/* input cells */
.select-cell {
  position: relative;
  background-color: #fefefe;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.select-cell input {
  width: 90%;
  height: 90%;
  border: none;
  font-size: 1.2rem;
  text-align: center;
  background: transparent;
  position: relative;
  z-index: 2;
}
.select-cell.correct {
  outline: 3px solid #28a745;
}
.select-cell.incorrect {
  outline: 3px solid #dc3545;
}
.select-cell.golden-settlement {
  border: 2px solid gold;
}
.select-cell.golden-settlement::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: url('https://upload.wikimedia.org/wikipedia/commons/1/10/Flag_of_Scotland.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.4;
  z-index: 1;
}

/* header & controls */
.header {
  text-align: center;
  margin-top: 20px;
  font-size: 2rem;
  color: #2c3e50;
}
.controls {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  gap: 10px;
  flex-wrap: wrap;
}
button {
  padding: 8px 16px;
  font-size: 0.95rem;
  border-radius: 5px;
  border: none;
  background-color: #2c3e50;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
button:hover { background-color: #1a242f; }

/* footer */
.site-footer {
  text-align: center;
  padding: 20px 0;
  color: #666;
  font-size: 0.9rem;
}
.site-footer p { font-style: italic; }

/* mobile adjustments */
@media screen and (max-width: 600px) {
  .grid-container {
    width: 100%;
    grid-template-columns: 80px repeat(3, 1fr);
  }

  .label-cell {
    font-size: 0.4rem;
    padding: 4px;
  }

  .select-cell input {
    font-size: 1rem;
  }
}
