:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --accent: #f2c94c;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 16px;
}

.app-header {
  text-align: center;
  margin-bottom: 20px;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.instructions {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.input-panel,
.results-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.field label {
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

button {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #111827;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.error {
  min-height: 20px;
  color: #dc2626;
  font-size: 0.95rem;
  margin: 8px 0 0;
}

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 600;
}

.stats span {
  color: var(--muted);
  font-weight: 500;
}

.results {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.results .word {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f4f6;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.muted {
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}

.hidden {
  display: none;
}

@media (min-width: 720px) {
  body {
    padding: 24px;
  }

  .layout {
    grid-template-columns: 1fr 2fr;
    align-items: start;
  }

  button {
    width: auto;
    align-self: flex-start;
    padding-inline: 24px;
  }

  .results {
    max-height: 70vh;
  }
}
