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

body {
  background: #fff;
  color: #1a1a1a;
  font-family: 'NYT Karnak', Georgia, serif;
  min-height: 100vh;
}

.app {
  max-width: 540px;
  margin: 0 auto;
  padding: 20px 16px;
}

header {
  text-align: center;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 14px;
  margin-bottom: 28px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

header .subtitle {
  color: #666;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Hive input */
.hive-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.hive {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 56px);
  gap: 4px;
  justify-content: center;
}

/* Hexagon cell layout positions */
.hive-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hive-cell input {
  width: 58px;
  height: 52px;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.15s;
  background: #f8f8f8;
  color: #1a1a1a;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.hive-cell input:focus {
  border-color: #888;
}

.hive-cell.center input {
  background: #f7da21;
  border-color: #f7da21;
}

.hive-cell.center input:focus {
  border-color: #d4b800;
}

/* Empty grid spots (corners of 3x3 not used) */
.hive-cell.blank {
  visibility: hidden;
}

/* Fallback text input mode */
.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  color: #666;
}

.input-row label {
  white-space: nowrap;
}

.input-row input {
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 8px 10px;
  text-transform: uppercase;
  outline: none;
  width: 100%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.input-row input:focus { border-color: #888; }

.center-input {
  width: 60px !important;
  text-align: center;
  background: #f7da21;
  border-color: #f7da21 !important;
  flex-shrink: 0;
}

/* Controls */
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

button {
  background: #1a1a1a;
  border: none;
  border-radius: 30px;
  color: #fff;
  cursor: pointer;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px 28px;
  transition: opacity 0.15s;
}

button:hover:not(:disabled) { opacity: 0.75; }
button:disabled { background: #ccc; color: #888; cursor: default; }

#clearBtn {
  background: #fff;
  border: 2px solid #ccc;
  color: #1a1a1a;
}

#clearBtn:hover { border-color: #888; opacity: 1; }

/* Status */
.status {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  color: #c0392b;
  text-align: center;
  min-height: 20px;
  margin-bottom: 16px;
}

/* Loading */
.loading {
  text-align: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  color: #888;
  padding: 20px 0;
}

/* Results */
.results {
  border-top: 2px solid #1a1a1a;
  padding-top: 20px;
}

.results.hidden { display: none; }

.results-summary {
  display: flex;
  justify-content: space-between;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 16px;
}

.results-summary strong { color: #1a1a1a; }

.section-label {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
  margin-top: 16px;
}

.section-label:first-of-type { margin-top: 0; }

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.word-chip {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  text-transform: uppercase;
  color: #1a1a1a;
}

.word-chip.pangram {
  background: #f7da21;
  border-color: #d4b800;
  color: #1a1a1a;
}

.score-badge {
  font-size: 0.7rem;
  color: #888;
  margin-left: 4px;
}

.word-chip.pangram .score-badge {
  color: #7a6800;
}
