body {
  font-family: "Inter", sans-serif;
}

.tool-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.primary-btn {
  background: #10b981;
  border: 1px solid #059669;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.primary-btn:hover {
  background: #059669;
  border-color: #047857;
}

.secondary-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.secondary-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* The Output Area */
.print-area {
  background: #fff;
  padding: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.puzzle-title-display {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.grid-container {
  display: grid;
  gap: 1px;
  background: #e5e7eb;
  border: 2px solid #374151;
  margin: 0 auto;
  width: max-content;
  max-width: 100%;
}

.grid-cell {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family:
    "JetBrains Mono", monospace; /* Monospace for perfect grid alignment */
  font-weight: 700;
  font-size: 18px;
  color: #111;
  user-select: none;
  width: 30px;
  height: 30px;
}

@media (max-width: 640px) {
  .grid-cell {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  .print-area {
    padding: 15px;
  }
}

.word-list-display {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: x 15px;
  column-gap: 30px;
  row-gap: 8px;
}
.word-item {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  text-transform: uppercase;
}

.error-msg {
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  display: none;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #header,
  #footer,
  #backtotop,
  #moretools,
  .controls-col,
  .page-header,
  .faq-section {
    display: none !important;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    padding: 0;
  }
  .grid-container {
    border-color: #000;
    background: #000;
    /* Force background print colors usually requires specific browser flags, 
           so a black border and gap simulates solid grid lines perfectly in B&W */
    gap: 1px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .grid-cell {
    background: #fff !important;
  }
}

.related-game-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.related-game-card:hover {
  border-color: #6ee7b7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}
.related-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
