* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #121212;
  color: #e8e6e3;
  display: flex;
  justify-content: center;
  padding: 24px 12px;
  margin: 0;
}

.app {
  max-width: 560px;
  width: 100%;
  text-align: center;
}

h1 {
  margin-bottom: 8px;
}

.spill-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 12px;
}

.spill-counter button {
  padding: 2px 12px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.banner {
  background: #ffd54f;
  color: #2b2b2b;
  border-radius: 8px;
  padding: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 auto 16px;
}

.cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  font-size: 0.85rem;
  background: #1e1e1e;
  color: #e8e6e3;
  border: 2px solid #3a3a3a;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  word-break: break-word;
}

.cell.marked {
  background: #1b3d22;
  border-color: #4caf50;
}

.cell.free {
  font-weight: bold;
  background: #4a3a00;
  border-color: #ffb300;
  color: #ffe082;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #1e1e1e;
  color: #e8e6e3;
  cursor: pointer;
  font-size: 0.9rem;
}

button:hover {
  background: #2a2a2a;
}

.editor {
  text-align: left;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor label {
  font-weight: bold;
  font-size: 0.9rem;
}

.editor textarea {
  width: 100%;
  font-size: 0.9rem;
  padding: 6px;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  font-family: inherit;
  background: #121212;
  color: #e8e6e3;
}

.editor-buttons {
  display: flex;
  gap: 8px;
}

.hint {
  font-size: 0.85rem;
  color: #999;
}
